WSL2-Linux-Kernel/kernel/rcu
Nikita Kiryushin af7b560c88 rcu-tasks: Fix show_rcu_tasks_trace_gp_kthread buffer overflow
commit cc5645fddb0ce28492b15520306d092730dffa48 upstream.

There is a possibility of buffer overflow in
show_rcu_tasks_trace_gp_kthread() if counters, passed
to sprintf() are huge. Counter numbers, needed for this
are unrealistically high, but buffer overflow is still
possible.

Use snprintf() with buffer size instead of sprintf().

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: edf3775f0a ("rcu-tasks: Add count for idle tasks on offline CPUs")
Signed-off-by: Nikita Kiryushin <kiryushin@ancud.ru>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Vamsi Krishna Brahmajosyula <vamsi-krishna.brahmajosyula@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-09-12 11:07:42 +02:00
..
Kconfig rcu: Make TASKS_RUDE_RCU select IRQ_WORK 2022-06-09 10:22:32 +02:00
Kconfig.debug rcu: Restrict RCU_STRICT_GRACE_PERIOD to at most four CPUs 2021-05-10 16:22:54 -07:00
Makefile
rcu.h Merge branches 'bitmaprange.2021.05.10c', 'doc.2021.05.10c', 'fixes.2021.05.13a', 'kvfree_rcu.2021.05.10c', 'mmdumpobj.2021.05.10c', 'nocb.2021.05.12a', 'srcu.2021.05.12a', 'tasks.2021.05.18a' and 'torture.2021.05.10c' into HEAD 2021-05-18 10:56:19 -07:00
rcu_segcblist.c rcu/nocb: Remove stale comment above rcu_segcblist_offload() 2021-03-15 13:54:54 -07:00
rcu_segcblist.h rcu: Mark writes to the rcu_segcblist structure's ->flags field 2022-04-08 14:23:55 +02:00
rcuscale.c rcuscale: Move rcu_scale_writer() schedule_timeout_uninterruptible() to _idle() 2023-09-23 11:09:55 +02:00
rcutorture.c rcutorture: Fix rcu_torture_fwd_cb_cr() data race 2024-08-19 05:45:36 +02:00
refscale.c refscale: Fix uninitalized use of wait_queue_head_t 2023-09-19 12:22:31 +02:00
srcutiny.c srcutiny: Mark read-side data races 2021-08-06 13:41:48 -07:00
srcutree.c Merge branches 'bitmaprange.2021.05.10c', 'doc.2021.05.10c', 'fixes.2021.05.13a', 'kvfree_rcu.2021.05.10c', 'mmdumpobj.2021.05.10c', 'nocb.2021.05.12a', 'srcu.2021.05.12a', 'tasks.2021.05.18a' and 'torture.2021.05.10c' into HEAD 2021-05-18 10:56:19 -07:00
sync.c rcu: Fix various typos in comments 2021-05-12 12:11:05 -07:00
tasks.h rcu-tasks: Fix show_rcu_tasks_trace_gp_kthread buffer overflow 2024-09-12 11:07:42 +02:00
tiny.c srcu: Initialize SRCU after timers 2021-05-10 16:03:35 -07:00
tree.c rcu: kmemleak: Ignore kmemleak false positives when RCU-freeing objects 2023-11-28 16:56:29 +00:00
tree.h rcu/nocb: Remove buggy bypass lock contention mitigation 2024-09-12 11:07:41 +02:00
tree_exp.h rcu: Prevent expedited GP from enabling tick on offline CPU 2023-09-02 09:17:07 +02:00
tree_nocb.h rcu/nocb: Remove buggy bypass lock contention mitigation 2024-09-12 11:07:41 +02:00
tree_plugin.h rcu: Avoid tracing a few functions executed in stop machine 2023-12-08 08:48:02 +01:00
tree_stall.h rcu/tree: Defer setting of jiffies during stall reset 2023-11-28 16:56:29 +00:00
update.c Merge branches 'bitmaprange.2021.05.10c', 'doc.2021.05.10c', 'fixes.2021.05.13a', 'kvfree_rcu.2021.05.10c', 'mmdumpobj.2021.05.10c', 'nocb.2021.05.12a', 'srcu.2021.05.12a', 'tasks.2021.05.18a' and 'torture.2021.05.10c' into HEAD 2021-05-18 10:56:19 -07:00