linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] softirq: redefine the type of kernel_stat.softirqs[] as unsigned long
@ 2023-07-24 13:22 thunder.leizhen
  2023-07-24 13:22 ` [PATCH 1/2] softirq: fix integer overflow in function show_stat() thunder.leizhen
  2023-07-24 13:22 ` [PATCH 2/2] softirq: redefine the type of kernel_stat.softirqs[] as unsigned long thunder.leizhen
  0 siblings, 2 replies; 8+ messages in thread
From: thunder.leizhen @ 2023-07-24 13:22 UTC (permalink / raw)
  To: Paul E . McKenney, Frederic Weisbecker, Neeraj Upadhyay,
	Joel Fernandes, Josh Triplett, Boqun Feng, Steven Rostedt,
	Mathieu Desnoyers, Lai Jiangshan, Zqiang, rcu, linux-kernel,
	linux-fsdevel
  Cc: Zhen Lei

From: Zhen Lei <thunder.leizhen@huawei.com>

The type of member softirqs in structure kernel_stat is unsigned int, its
accumulated value can easily overflow. Changing to unsigned long can safely 
solve the problem on 64-bit processors.

 struct kernel_stat {
 	unsigned long irqs_sum;
-	unsigned int softirqs[NR_SOFTIRQS];
+	unsigned long softirqs[NR_SOFTIRQS];


Zhen Lei (2):
  softirq: fix integer overflow in function show_stat()
  softirq: redefine the type of kernel_stat.softirqs[] as unsigned long

 fs/proc/softirqs.c          | 2 +-
 fs/proc/stat.c              | 4 ++--
 include/linux/kernel_stat.h | 8 ++++----
 kernel/rcu/tree.h           | 2 +-
 kernel/rcu/tree_stall.h     | 6 +++---
 5 files changed, 11 insertions(+), 11 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-26  0:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24 13:22 [PATCH 0/2] softirq: redefine the type of kernel_stat.softirqs[] as unsigned long thunder.leizhen
2023-07-24 13:22 ` [PATCH 1/2] softirq: fix integer overflow in function show_stat() thunder.leizhen
2023-07-24 13:50   ` Matthew Wilcox
2023-07-25  2:00     ` Leizhen (ThunderTown)
2023-07-25  9:09       ` Leizhen (ThunderTown)
2023-07-25 15:26         ` Matthew Wilcox
2023-07-26  0:59           ` Leizhen (ThunderTown)
2023-07-24 13:22 ` [PATCH 2/2] softirq: redefine the type of kernel_stat.softirqs[] as unsigned long thunder.leizhen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).