mirror of
https://github.com/torvalds/linux.git
synced 2025-11-03 01:59:51 +02:00
In case push_rcu() and related functions are buggy, there's a
WARN_ON(len >= 128), which the selftest tries to hit by being tricky. In
case it is hit, we shouldn't corrupt the kernel's stack, though;
otherwise it may be hard to even receive the report that it's buggy. So
conditionalize the stack write based on that WARN_ON()'s return value.
Note that this never *actually* happens anyway. The WARN_ON() in the
first place is bounded by IS_ENABLED(DEBUG), and isn't expected to ever
actually hit. This is just a debugging sanity check.
Additionally, hoist the constant 128 into a named enum,
MAX_ALLOWEDIPS_BITS, so that it's clear why this value is chosen.
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/all/CAHk-=wjJZGA6w_DxA+k7Ejbqsq+uGK==koPai3sqdsfJqemvag@mail.gmail.com/
Fixes:
|
||
|---|---|---|
| .. | ||
| selftest | ||
| allowedips.c | ||
| allowedips.h | ||
| cookie.c | ||
| cookie.h | ||
| device.c | ||
| device.h | ||
| main.c | ||
| Makefile | ||
| messages.h | ||
| netlink.c | ||
| netlink.h | ||
| noise.c | ||
| noise.h | ||
| peer.c | ||
| peer.h | ||
| peerlookup.c | ||
| peerlookup.h | ||
| queueing.c | ||
| queueing.h | ||
| ratelimiter.c | ||
| ratelimiter.h | ||
| receive.c | ||
| send.c | ||
| socket.c | ||
| socket.h | ||
| timers.c | ||
| timers.h | ||
| version.h | ||