[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202310261016.2D17ACACE@keescook>
Date: Thu, 26 Oct 2023 10:18:33 -0700
From: Kees Cook <keescook@...omium.org>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Robert Richter <rric@...nel.org>, Borislav Petkov <bp@...en8.de>,
Tony Luck <tony.luck@...el.com>, James Morse <james.morse@....com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Sergey Temerkhanov <s.temerkhanov@...il.com>,
linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org, Borislav Petkov <bp@...e.de>,
linux-edac@...r.kernel.org
Subject: Re: [PATCH v2] EDAC/thunderx: Fix some potential buffer overflow in
thunderx_ocx_com_threaded_isr()
On Tue, Oct 24, 2023 at 04:39:36PM -0700, Kees Cook wrote:
> As the replacements get longer, I would encourage you to use seq_buf
> instead -- it does all the length math internally. For example:
There's some ongoing work to make seq_buf easier to use:
https://lore.kernel.org/lkml/20231026170722.work.638-kees@kernel.org/
Perhaps we can add an "alloc" and "free" pair too, to handle this case:
> msg = kmalloc(OCX_MESSAGE_SIZE, GFP_KERNEL);
> seq_buf_init(&s, msg, OCX_MESSAGE_SIZE);
But perhaps it's overkill...
--
Kees Cook
Powered by blists - more mailing lists