[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.7] tools/kdd: don't use a pointer to an unaligned field.
commit e54670ff2665ca62173a5805d0e5b2f8476fa15c Author: Tim Deegan <tim@xxxxxxx> AuthorDate: Thu Feb 15 13:10:54 2018 +0100 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Thu Feb 15 13:10:54 2018 +0100 tools/kdd: don't use a pointer to an unaligned field. The 'val' field in the packet is byte-aligned (because it is part of a packed struct), but the pointer argument to kdd_rdmsr() has the normal alignment constraints for a uint64_t *. Use a local variable to make sure the passed pointer has the correct alignment. Reported-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> Signed-off-by: Tim Deegan <tim@xxxxxxx> Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> Tested-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> master commit: bfd9a2095f1882e8c074b2d911bcb07d12cf6cf5 master date: 2017-03-15 10:57:00 +0000 --- tools/debugger/kdd/kdd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/debugger/kdd/kdd.c b/tools/debugger/kdd/kdd.c index 70f007e..1bd5dd5 100644 --- a/tools/debugger/kdd/kdd.c +++ b/tools/debugger/kdd/kdd.c @@ -710,11 +710,13 @@ static void kdd_handle_read_ctrl(kdd_state *s) static void kdd_handle_read_msr(kdd_state *s) { uint32_t msr = s->rxp.cmd.msr.msr; + uint64_t val; int ok; KDD_LOG(s, "Read MSR 0x%"PRIx32"\n", msr); - ok = (kdd_rdmsr(s->guest, s->cpuid, msr, &s->txp.cmd.msr.val) == 0); + ok = (kdd_rdmsr(s->guest, s->cpuid, msr, &val) == 0); s->txp.cmd.msr.msr = msr; + s->txp.cmd.msr.val = val; s->txp.cmd.msr.status = (ok ? KDD_STATUS_SUCCESS : KDD_STATUS_FAILURE); kdd_send_cmd(s, KDD_CMD_READ_MSR, 0); } -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.7 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |