]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rcu: Return early if callback is not specified
authorUladzislau Rezki (Sony) <urezki@gmail.com>
Tue, 10 Jun 2025 17:34:48 +0000 (19:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 14:03:17 +0000 (16:03 +0200)
commit817662f9bdf81fb5c040aa94b44669f3d345a07d
tree267971cad547d70b22ec26a99f611261b0c483d8
parentd5c1e3f32902ab518519d05515ee6030fd6c59ae
rcu: Return early if callback is not specified

[ Upstream commit 33b6a1f155d627f5bd80c7485c598ce45428f74f ]

Currently the call_rcu() API does not check whether a callback
pointer is NULL. If NULL is passed, rcu_core() will try to invoke
it, resulting in NULL pointer dereference and a kernel crash.

To prevent this and improve debuggability, this patch adds a check
for NULL and emits a kernel stack trace to help identify a faulty
caller.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/rcu/tree.c