[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <CBE23F82-A597-4DC5-A297-26F8DEFA07B0@linux.dev>
Date: Tue, 4 Feb 2025 17:44:55 +0100
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Kees Cook <kees@...nel.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [RESEND PATCH v2] params: Annotate struct module_param_attrs with
__counted_by()
On 14. Jan 2025, at 22:49, Thorsten Blum wrote:
> Add the __counted_by compiler attribute to the flexible array member
> attrs to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
> CONFIG_FORTIFY_SOURCE.
>
> Increment num before adding a new param_attribute to the attrs array and
> adjust the array index accordingly. Increment num immediately after the
> first reallocation such that the reallocation for the NULL terminator
> only needs to add 1 (instead of 2) to mk->mp->num.
>
> Use struct_size() instead of manually calculating the size for the
> reallocation.
>
> Use krealloc_array() for the additional NULL terminator.
Hi, could someone please take another look at this?
It was already applied to modules-next in August 2024, but dropped
shortly after because of a Clang issue:
https://lore.kernel.org/all/20241029140036.577804-1-kernel@jfarr.cc
The Clang issue has been fixed for a while and this patch could be
applied again.
Thanks,
Thorsten
Powered by blists - more mailing lists