+2
−1
Loading
stable inclusion from stable-v6.6.33 commit afb39909bfb5c08111f99e21bf5be7505f59ff1c category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IA6S9X CVE: CVE-2024-38576 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=afb39909bfb5c08111f99e21bf5be7505f59ff1c -------------------------------- [ Upstream commit 3758f7d9917bd7ef0482c4184c0ad673b4c4e069 ] The rcuc-starvation output from print_cpu_stall_info() might overflow the buffer if there is a huge difference in jiffies difference. The situation might seem improbable, but computers sometimes get very confused about time, which can result in full-sized integers, and, in this case, buffer overflow. Also, the unsigned jiffies difference is printed using %ld, which is normally for signed integers. This is intentional for debugging purposes, but it is not obvious from the code. This commit therefore changes sprintf() to snprintf() and adds a clarifying comment about intention of %ld format. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 245a6298 ("rcu: Dump rcuc kthread status for CPUs not reporting quiescent state") 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:
Yu Liao <liaoyu15@huawei.com>