]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/misc: use extract64 instead of 1 << i
authorTigran Sogomonian <tsogomonian@astralinux.ru>
Fri, 27 Dec 2024 10:46:18 +0000 (13:46 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 17 Mar 2025 07:53:25 +0000 (08:53 +0100)
commitd18591157e5adf0e4491eed9b2c99828ba52bd80
tree2d2ec1db2006b8786eac3ede934d60acec678129
parentaa90f1161bb17a4863e16ec2f75104cff0752d4e
hw/misc: use extract64 instead of 1 << i

1 << i is casted to uint64_t while bitwise and with val.
So this value may become 0xffffffff80000000 but only
31th "start" bit is required.
Use the bitfield extract() API instead.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Tigran Sogomonian <tsogomonian@astralinux.ru>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Link: https://lore.kernel.org/r/20241227104618.2526-1-tsogomonian@astralinux.ru
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/misc/mps2-fpgaio.c