[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <be2b886f-4de7-46b5-9cc6-cc5299b1af02@suswa.mountain>
Date: Wed, 25 Jun 2025 21:40:56 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: "Luck, Tony" <tony.luck@...el.com>
Cc: Uwe Kleine-König <u.kleine-koenig@...libre.com>,
Zaid Alali <zaidal@...amperecomputing.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>, James Morse <james.morse@....com>,
Borislav Petkov <bp@...en8.de>, "Weiny, Ira" <ira.weiny@...el.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>,
"Williams, Dan J" <dan.j.williams@...el.com>,
Al Viro <viro@...iv.linux.org.uk>,
Sudeep Holla <sudeep.holla@....com>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH v2 next] ACPI: APEI: EINJ: prevent memory corruption in
error_type_set()
On Wed, Jun 25, 2025 at 06:22:57PM +0000, Luck, Tony wrote:
> > > + if (count > sizeof(einj_buf))
>
> Why not:
> /* Leave the last character for the NUL terminator */
> if (count > sizeof(einj_buf) - 1)
> return -EINVAL;
>
> here. Then skip the min(...) addition below.
Yeah. You're right. That's a better fix.
regards,
dan carpenter
Powered by blists - more mailing lists