From: thunder.leizhen@huaweicloud.com
To: "Paul E . McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <quic_neeraju@quicinc.com>,
Joel Fernandes <joel@joelfernandes.org>,
Josh Triplett <josh@joshtriplett.org>,
Boqun Feng <boqun.feng@gmail.com>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <jiangshanlai@gmail.com>,
Zqiang <qiang.zhang1211@gmail.com>,
rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Cc: Zhen Lei <thunder.leizhen@huawei.com>
Subject: [PATCH 0/2] softirq: redefine the type of kernel_stat.softirqs[] as unsigned long
Date: Mon, 24 Jul 2023 21:22:22 +0800 [thread overview]
Message-ID: <20230724132224.916-1-thunder.leizhen@huaweicloud.com> (raw)
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
next reply other threads:[~2023-07-24 13:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 13:22 thunder.leizhen [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230724132224.916-1-thunder.leizhen@huaweicloud.com \
--to=thunder.leizhen@huaweicloud.com \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=qiang.zhang1211@gmail.com \
--cc=quic_neeraju@quicinc.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=thunder.leizhen@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).