Re: Re: [GIT PULL] sysctl constification changes for v6.14-rc1
From: Kees Cook
Date: Fri Jan 31 2025 - 15:03:53 EST
On Fri, Jan 31, 2025 at 02:57:40PM +0100, Joel Granados wrote:
> From 431abf6c9c11a8b7321842ed0747b3200d43ef34 Mon Sep 17 00:00:00 2001
> From: Joel Granados <joel.granados@xxxxxxxxxx>
> Date: Fri, 31 Jan 2025 14:10:57 +0100
> Subject: [PATCH] csky: Remove the size from alignment_tbl declaration
>
> Having to synchronize the number of ctl_table array elements with the
> size in the declaration can lead to discrepancies between the two
> values. Since commit d7a76ec87195 ("sysctl: Remove check for sentinel
> element in ctl_table arrays"), the calculation of the ctl_table array
> size is done solely by the ARRAY_SIZE macro removing the need for the
> size in the declaration.
>
> Remove the size for the aligment_tbl declaration and const qualify the
> array for good measure.
>
> Signed-off-by: Joel Granados <joel.granados@xxxxxxxxxx>
FWIW, this looks correct to me.
Reviewed-by: Kees Cook <kees@xxxxxxxxxx>
--
Kees Cook