linux-kernelorg-stable/include
Matt Evans 6246541522
locking/atomic: cmpxchg: Make __generic_cmpxchg_local compare against zero-extended 'old' value
__generic_cmpxchg_local takes unsigned long old/new arguments which
might end up being up-cast from smaller signed types (which will
sign-extend).  The loaded compare value must be compared against a
truncated smaller type, so down-cast appropriately for each size.

The issue is apparent on 64-bit machines with code, such as
atomic_dec_unless_positive(), that sign-extends from int.

64-bit machines generally don't use the generic cmpxchg but
development/early ports might make use of it, so make it correct.

Signed-off-by: Matt Evans <mev@rivosinc.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-02-03 15:31:23 +01:00
..
acpi ACPI: video: Allow GPU drivers to report no panels 2022-12-22 17:26:41 +01:00
asm-generic locking/atomic: cmpxchg: Make __generic_cmpxchg_local compare against zero-extended 'old' value 2023-02-03 15:31:23 +01:00
clocksource
crypto
drm
dt-bindings remoteproc updates for v6.2 2022-12-21 09:37:14 -08:00
keys
kunit
kvm
linux block-6.2-2022-12-29 2022-12-29 16:57:29 -08:00
math-emu
media
memory
misc
net 9p-for-6.2-rc1 2022-12-23 11:39:18 -08:00
pcmcia
ras
rdma
rv
scsi SCSI misc on 20221222 2022-12-22 11:22:31 -08:00
soc
sound
target
trace pwm: Changes for v6.2-rc1 2022-12-21 09:41:28 -08:00
uapi io_uring-6.2-2022-12-29 2022-12-29 16:48:21 -08:00
ufs
vdso
video
xen