linux/kernel/rcu
Nikita Kiryushin cc5645fddb rcu-tasks: Fix show_rcu_tasks_trace_gp_kthread buffer overflow
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>
2024-04-15 19:36:55 +02:00
..
Kconfig rcu: Provide a boot time parameter to control lazy RCU 2024-02-14 08:00:57 -08:00
Kconfig.debug rcu: Restrict access to RCU CPU stall notifiers 2023-12-12 02:31:22 +05:30
Makefile rcuperf: Change rcuperf to rcuscale 2020-08-24 18:39:24 -07:00
rcu_segcblist.c rcu: Use rcu_segcblist_segempty() instead of open coding it 2023-10-04 17:33:18 +02:00
rcu_segcblist.h rcu: Throttle callback invocation based on number of ready callbacks 2023-01-03 17:28:34 -08:00
rcu.h Merge branches 'rcu-doc.2024.02.14a', 'rcu-nocb.2024.02.14a', 'rcu-exp.2024.02.14a', 'rcu-tasks.2024.02.26a' and 'rcu-misc.2024.02.14a' into rcu.2024.02.26a 2024-02-26 17:37:25 -08:00
rcuscale.c rcu: Rename jiffies_till_flush to jiffies_lazy_flush 2024-02-14 08:00:57 -08:00
rcutorture.c rcutorture: Suppress rtort_pipe_count warnings until after stalls 2024-02-14 08:00:57 -08:00
refscale.c refscale: Print out additional module parameters 2023-09-11 23:02:18 +02:00
srcutiny.c rcu: Dump memory object info if callback function is invalid 2023-09-13 22:29:12 +02:00
srcutree.c srcu: Improve comments about acceleration leak 2024-02-14 08:00:57 -08:00
sync.c rcu/sync: remove un-used rcu_sync_enter_start function 2024-02-14 08:00:57 -08:00
tasks.h rcu-tasks: Fix show_rcu_tasks_trace_gp_kthread buffer overflow 2024-04-15 19:36:55 +02:00
tiny.c rcu-tasks: Initialize callback lists at rcu_init() time 2024-02-25 14:21:34 -08:00
tree_exp.h rcu/exp: Remove rcu_par_gp_wq 2024-02-14 07:51:36 -08:00
tree_nocb.h Merge branches 'rcu-doc.2024.02.14a', 'rcu-nocb.2024.02.14a', 'rcu-exp.2024.02.14a', 'rcu-tasks.2024.02.26a' and 'rcu-misc.2024.02.14a' into rcu.2024.02.26a 2024-02-26 17:37:25 -08:00
tree_plugin.h rcu/exp: Handle parallel exp gp kworkers affinity 2024-02-14 07:51:36 -08:00
tree_stall.h rcu: Restrict access to RCU CPU stall notifiers 2023-12-12 02:31:22 +05:30
tree.c Merge branches 'rcu-doc.2024.02.14a', 'rcu-nocb.2024.02.14a', 'rcu-exp.2024.02.14a', 'rcu-tasks.2024.02.26a' and 'rcu-misc.2024.02.14a' into rcu.2024.02.26a 2024-02-26 17:37:25 -08:00
tree.h Merge branches 'rcu-doc.2024.02.14a', 'rcu-nocb.2024.02.14a', 'rcu-exp.2024.02.14a', 'rcu-tasks.2024.02.26a' and 'rcu-misc.2024.02.14a' into rcu.2024.02.26a 2024-02-26 17:37:25 -08:00
update.c rcu-tasks: Make Tasks RCU wait idly for grace-period delays 2024-04-09 15:11:49 +02:00