Re: [Qemu-devel] [PATCH 2/2] io: fix stack allocation when sending of file descriptors

2015-12-23 Thread Daniel P. Berrange
On Tue, Dec 22, 2015 at 11:20:30AM -0700, Eric Blake wrote: > On 12/21/2015 09:23 AM, Daniel P. Berrange wrote: > > When sending file descriptors over a socket, we have to > > allocate a data buffer to hold the FDs in the scmsghdr. > > Unfortunately we allocated the buffer on the stack inside > > a

Re: [Qemu-devel] [PATCH 2/2] io: fix stack allocation when sending of file descriptors

2015-12-22 Thread Eric Blake
On 12/21/2015 09:23 AM, Daniel P. Berrange wrote: > When sending file descriptors over a socket, we have to > allocate a data buffer to hold the FDs in the scmsghdr. > Unfortunately we allocated the buffer on the stack inside > an if () {} block, but called sendmsg() outside the block. > So the sta

[Qemu-devel] [PATCH 2/2] io: fix stack allocation when sending of file descriptors

2015-12-21 Thread Daniel P. Berrange
When sending file descriptors over a socket, we have to allocate a data buffer to hold the FDs in the scmsghdr. Unfortunately we allocated the buffer on the stack inside an if () {} block, but called sendmsg() outside the block. So the stack bytes holding the FDs were liable to be overwritten with