[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <29e4b08e-935c-471c-b802-bdc616ba90d5@paulmck-laptop>
Date: Thu, 21 Aug 2025 08:27:55 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Qianfeng Rong <rongqianfeng@...o.com>
Cc: Davidlohr Bueso <dave@...olabs.net>,
Josh Triplett <josh@...htriplett.org>,
Frederic Weisbecker <frederic@...nel.org>,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
Joel Fernandes <joelagnelf@...dia.com>,
Boqun Feng <boqun.feng@...il.com>,
Uladzislau Rezki <urezki@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Zqiang <qiang.zhang@...ux.dev>,
"open list:TORTURE-TEST MODULES" <linux-kernel@...r.kernel.org>,
"open list:READ-COPY UPDATE (RCU)" <rcu@...r.kernel.org>
Subject: Re: [PATCH 0/2] rcu: Use kcalloc() instead of kzalloc()
On Thu, Aug 21, 2025 at 09:41:15PM +0800, Qianfeng Rong wrote:
> Replace kzalloc() with kcalloc() in kernel/rcu. As noted in the kernel
> documentation [1], open-coded multiplication in allocator arguments is
> discouraged because it can lead to integer overflow.
>
> Use kcalloc() to gain built-in overflow protection, making memory
> allocation safer when calculating allocation size compared to explicit
> multiplication.
>
> Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments #1
> Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
Queued for review and testing, thank you!
Thanx, Paul
> Qianfeng Rong (2):
> rcutorture: Use kcalloc() instead of kzalloc()
> refscale: Use kcalloc() instead of kzalloc()
>
> kernel/rcu/rcutorture.c | 4 ++--
> kernel/rcu/refscale.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> --
> 2.34.1
>
Powered by blists - more mailing lists