Skip to content

Commit afa3d8b

Browse files
committed
Merge tag 'rcu/fixes-for-6.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux
Pull RCU fix from Joel Fernandes: "We recently got a report of a crash [1] with misuse of call_rcu(). Instead of crashing the kernel, a warning and graceful return is better: - rcu: Return early if callback is not specified (Uladzislau Rezki)" Link: https://lore.kernel.org/all/aEnVuzK7VhGSizWj@pc636/ [1] * tag 'rcu/fixes-for-6.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux: rcu: Return early if callback is not specified
2 parents 7c7f9dd + 33b6a1f commit afa3d8b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kernel/rcu/tree.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,6 +3072,10 @@ __call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy_in)
30723072
/* Misaligned rcu_head! */
30733073
WARN_ON_ONCE((unsigned long)head & (sizeof(void *) - 1));
30743074

3075+
/* Avoid NULL dereference if callback is NULL. */
3076+
if (WARN_ON_ONCE(!func))
3077+
return;
3078+
30753079
if (debug_rcu_head_queue(head)) {
30763080
/*
30773081
* Probable double call_rcu(), so leak the callback.

0 commit comments

Comments
 (0)