Re: [PATCH v2] kvm: Fix kvm_vm_ioctl() and kvm_device_ioctl() return value
Michael Tokarev writes: > On 11/28/25 18:20, Markus Armbruster wrote: >> These functions wrap ioctl(). When ioctl() fails, it sets @errno. >> The wrappers then return that @errno negated. >> >> Except they call accel_ioctl_end() between calling ioctl() and reading >> @errno. accel_ioctl_end() can clobber @errno, e.g. when a futex() >> system call fails. Seems unlikely, but it's a bug all the same. >> >> Fix by retrieving @errno before calling accel_ioctl_end(). >> >> Fixes: a27dd2de68f3 (KVM: keep track of running ioctls) >> Signed-off-by: Markus Armbruster >> Reviewed-by: Philippe Mathieu-Daudé > > Isn't this a qemu-stable material? I think it is. I should've thought of adding Cc: qemu-stable. My apologies!
Re: [PATCH v2] kvm: Fix kvm_vm_ioctl() and kvm_device_ioctl() return value
On 11/28/25 18:20, Markus Armbruster wrote: These functions wrap ioctl(). When ioctl() fails, it sets @errno. The wrappers then return that @errno negated. Except they call accel_ioctl_end() between calling ioctl() and reading @errno. accel_ioctl_end() can clobber @errno, e.g. when a futex() system call fails. Seems unlikely, but it's a bug all the same. Fix by retrieving @errno before calling accel_ioctl_end(). Fixes: a27dd2de68f3 (KVM: keep track of running ioctls) Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daudé Isn't this a qemu-stable material? Thanks, /mjt
Re: [PATCH v2] kvm: Fix kvm_vm_ioctl() and kvm_device_ioctl() return value
Markus Armbruster writes: > These functions wrap ioctl(). When ioctl() fails, it sets @errno. > The wrappers then return that @errno negated. > > Except they call accel_ioctl_end() between calling ioctl() and reading > @errno. accel_ioctl_end() can clobber @errno, e.g. when a futex() > system call fails. Seems unlikely, but it's a bug all the same. > > Fix by retrieving @errno before calling accel_ioctl_end(). > > Fixes: a27dd2de68f3 (KVM: keep track of running ioctls) > Signed-off-by: Markus Armbruster > Reviewed-by: Philippe Mathieu-Daudé Queued for 10.2.
