Re: [PATCH][next] mm/pgtable: Fix multiple -Wstringop-overflow warnings

From: Kees Cook
Date: Sat Nov 26 2022 - 20:04:40 EST


On Wed, 21 Sep 2022 13:46:03 -0500, Gustavo A. R. Silva wrote:
> The actual size of the following arrays at run-time depends on
> CONFIG_X86_PAE.
>
> 427 pmd_t *u_pmds[MAX_PREALLOCATED_USER_PMDS];
> 428 pmd_t *pmds[MAX_PREALLOCATED_PMDS];
>
> If CONFIG_X86_PAE is not enabled, their final size will be zero. In that
> case, the compiler complains about trying to access objects of size zero
> when calling functions where these objects are passed as arguments.
>
> [...]

Applied to for-next/hardening with tweaks to the commit log, thanks!

[1/1] mm/pgtable: Fix multiple -Wstringop-overflow warnings
https://git.kernel.org/kees/c/9af98f78d2cd

--
Kees Cook