On 4/20/20 12:53 PM, Eric Blake wrote:
Blindly setting FD_CLOEXEC without a read-modify-write will
inadvertently clear any other intentionally-set bits, such as a
proposed new bit for designating a fd that must behave in 32-bit mode.
However, we cannot use our wrapper qemu_set_cloexec(), because that
wrapper intentionally abort()s on failure, whereas the probe here
intentionally tolerates failure to deal with incorrect socket
activation gracefully.  Instead, fix the code to do the proper
read-modify-write.

Signed-off-by: Eric Blake <ebl...@redhat.com>
---
  util/systemd.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

As qemu-nbd is impacted, I'll queue 2/2 through my NBD tree if qemu-trivial doesn't pick it up first.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


Reply via email to