Re: [PATCH] parisc: Fix lightweight spinlock checks to not break futexes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023-08-09 3:12 a.m., Helge Deller wrote:
The lightweight spinlock checks verify that a spinlock has either value
0 (spinlock locked) and that not any other bits than in
__ARCH_SPIN_LOCK_UNLOCKED_VAL is set.

This breaks the current LWS code, which writes the address of the lock
into the lock word to unlock it, which was an optimization to save one
assembler instruction.

Fix it by making spinlock_types.h accessible for asm code, change the
LWS spinlock-unlocking code to write __ARCH_SPIN_LOCK_UNLOCKED_VAL into
the lock word, and add some missing lightweight spinlock checks to the
LWS path. Finally, make the spinlock checks dependend on DEBUG_KERNEL.

Noticed-by: John David Anglin<dave.anglin@xxxxxxxx>
Signed-off-by: Helge Deller<deller@xxxxxx>
Cc:stable@xxxxxxxxxxxxxxx  # v6.4+
Fixes: 15e64ef6520e ("parisc: Add lightweight spinlock checks")
Fixes system crash in glibc testsuite.

Tested-by: John David Anglin <dave.anglin@xxxxxxxx>

--
John David Anglin  dave.anglin@xxxxxxxx




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux