futex: FLAGS_STRICT
authorpeterz@infradead.org <peterz@infradead.org>
Thu, 21 Sep 2023 10:45:11 +0000 (12:45 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 21 Sep 2023 17:22:07 +0000 (19:22 +0200)
commit43adf844951084c266f172561f84c5f8120dd60b
tree6a506adc83de717d2c4bcaa2b3fdded724bba24f
parent9f6c532f59b20580acf8ede9409c9b8dce6e74e1
futex: FLAGS_STRICT

The current semantics for futex_wake() are a bit loose, specifically
asking for 0 futexes to be woken actually gets you 1.

Adding a !nr check to sys_futex_wake() makes that it would return 0
for unaligned futex words, because that check comes in the shared
futex_wake() function. Adding the !nr check there, would affect the
legacy sys_futex() semantics.

Hence frob a flag :-(

Suggested-by: André Almeida <andrealmeid@igalia.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230921105248.048643656@noisy.programming.kicks-ass.net
kernel/futex/futex.h
kernel/futex/syscalls.c
kernel/futex/waitwake.c