kernel_samsung_a53x/kernel/rcu
Nikita Kiryushin 84d6dbf54c 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: edf3775f0ad6 ("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-11-23 23:20:59 +01:00
..
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig.debug Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rcu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rcu_segcblist.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rcu_segcblist.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rcuscale.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rcutorture.c rcutorture: Fix rcu_torture_fwd_cb_cr() data race 2024-11-23 23:20:22 +01:00
refscale.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
srcutiny.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
srcutree.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sync.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tasks.h rcu-tasks: Fix show_rcu_tasks_trace_gp_kthread buffer overflow 2024-11-23 23:20:59 +01:00
tiny.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tree.c rcu: Avoid unnecessary softirq when system is idle 2024-11-19 17:34:20 +01:00
tree.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tree_exp.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tree_plugin.h rcu_boost: always without delay 2024-11-17 17:37:56 +01:00
tree_stall.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
update.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00