[Qemu-devel] [Bug 1781280] Re: QEMU ignores all but the first control message sent over a Unix socket

2018-07-16 Thread Jonas Schievink
I've attached a patch doing that and verified that it fixes the issue. The test program I used can be found here: https://gist.github.com /jonas-schievink/cb6e6584a055539d2113f22d91068e2d To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1781280/+subscriptions

Re: [Qemu-devel] [PATCH v2] Zero out the host's `msg_control` buffer

2018-07-12 Thread Jonas Schievink
Yes, I do. See https://gist.github.com/jonas-schievink/cb6e6584a055539d2113f22d91068e2d The problem is that glibc's CMSG_NXTHDR macro will access the header of the *next* message which isn't yet overwritten by QEMU, so it still contains garbage at that point. In particular, it will

[Qemu-devel] [PATCH v2] Zero out the host's `msg_control` buffer

2018-07-11 Thread Jonas Schievink
rceware.org/bugzilla/show_bug.cgi?id=13500 It's probably also a good idea to bail with an error if `CMSG_NXTHDR` returns NULL but `TARGET_CMSG_NXTHDR` doesn't (ie. we still expect cmsgs). Signed-off-by: Jonas Schievink --- Changes in v2: - put the memset right after the msg_control alloca - ad

[Qemu-devel] [Bug 1781280] [NEW] QEMU ignores all but the first control message sent over a Unix socket

2018-07-11 Thread Jonas Schievink
ould *never* reach its end before the target buffer does, so an assertion might be more useful there. Anyway, the actual fix for this bug is simply zeroing out the buffer created for the host. I've attached a patch doing that and verified that it fixes the issue. The t

[Qemu-devel] [PATCH] Zero out the host's `msg_control` buffer

2018-07-10 Thread Jonas Schievink
(Apparently I messed up my git config for the last email so it didn't send the correct name - please bear with me, this is my first time submitting a patch to a mailing list. I've also added a link to the upstream bug in the commit description.) If this is not done, qemu would drop any control mes