linux-stable/kernel/rcu
Catalin Marinas 94fda7ef2f rcu: kmemleak: Ignore kmemleak false positives when RCU-freeing objects
commit 5f98fd034c upstream.

Since the actual slab freeing is deferred when calling kvfree_rcu(), so
is the kmemleak_free() callback informing kmemleak of the object
deletion. From the perspective of the kvfree_rcu() caller, the object is
freed and it may remove any references to it. Since kmemleak does not
scan RCU internal data storing the pointer, it will report such objects
as leaks during the grace period.

Tell kmemleak to ignore such objects on the kvfree_call_rcu() path. Note
that the tiny RCU implementation does not have such issue since the
objects can be tracked from the rcu_ctrlblk structure.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Christoph Paasch <cpaasch@apple.com>
Closes: https://lore.kernel.org/all/F903A825-F05F-4B77-A2B5-7356282FBA2C@apple.com/
Cc: <stable@vger.kernel.org>
Tested-by: Christoph Paasch <cpaasch@apple.com>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 17:15:05 +00:00
..
Kconfig rcu: Employ jiffies-based backstop to callback time limit 2023-05-11 13:42:39 -07:00
Kconfig.debug rcu: Allow up to five minutes expedited RCU CPU stall-warning timeouts 2023-01-09 12:09:52 -08:00
Makefile
rcu.h rcu-tasks: Stop rcu_tasks_invoke_cbs() from using never-onlined CPUs 2023-05-11 13:42:39 -07:00
rcu_segcblist.c rcu: Throttle callback invocation based on number of ready callbacks 2023-01-03 17:28:34 -08:00
rcu_segcblist.h rcu: Throttle callback invocation based on number of ready callbacks 2023-01-03 17:28:34 -08:00
rcuscale.c rcuscale: Move rcu_scale_writer() schedule_timeout_uninterruptible() to _idle() 2023-09-23 11:14:18 +02:00
rcutorture.c Merge branches 'rcu/staging-core', 'rcu/staging-docs' and 'rcu/staging-kfree', remote-tracking branches 'paul/srcu-cf.2023.04.04a', 'fbq/rcu/lockdep.2023.03.27a' and 'fbq/rcu/rcutorture.2023.03.20a' into rcu/staging 2023-04-05 13:50:37 +00:00
refscale.c refscale: Fix uninitalized use of wait_queue_head_t 2023-09-13 09:52:59 +02:00
srcutiny.c rcu: Annotate SRCU's update-side lockdep dependencies 2023-03-27 11:15:59 -07:00
srcutree.c srcu: Only accelerate on enqueue time 2023-11-28 17:14:41 +00:00
sync.c rcu/sync: Use call_rcu_hurry() instead of call_rcu 2022-11-29 14:04:33 -08:00
tasks.h Merge branches 'doc.2023.05.10a', 'fixes.2023.05.11a', 'kvfree.2023.05.10a', 'nocb.2023.05.11a', 'rcu-tasks.2023.05.10a', 'torture.2023.05.15a' and 'rcu-urgent.2023.06.06a' into HEAD 2023-06-07 13:44:06 -07:00
tiny.c rcu: Refactor kvfree_call_rcu() and high-level helpers 2023-01-03 17:48:40 -08:00
tree.c rcu: kmemleak: Ignore kmemleak false positives when RCU-freeing objects 2023-11-28 17:15:05 +00:00
tree.h rcu/tree: Defer setting of jiffies during stall reset 2023-11-28 17:15:05 +00:00
tree_exp.h rcu: Mark additional concurrent load from ->cpu_no_qs.b.exp 2023-05-11 13:42:39 -07:00
tree_nocb.h rcu/nocb: Make shrinker iterate only over NOCB CPUs 2023-05-11 13:44:50 -07:00
tree_plugin.h rcu: Mark additional concurrent load from ->cpu_no_qs.b.exp 2023-05-11 13:42:39 -07:00
tree_stall.h rcu/tree: Defer setting of jiffies during stall reset 2023-11-28 17:15:05 +00:00
update.c Merge branch 'stall.2023.01.09a' into HEAD 2023-02-02 16:40:07 -08:00