Re: [PATCH] media: mali-c55: add padding to mali_c55_params_ccm structure
From: Vincenzo Frascino
Date: Wed Sep 16 2026 - 12:24:38 EST
Hi Arnd,
quick question since you are mentioning information leaking in the commit message.
On 15/09/2026 21:24, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> The newly added structure has extra padding on the on
> some architectures, which triggers a pedantic uapi check:
>
> ./usr/include/linux/media/arm/mali-c55-config.h:807:1: error: padding struct size to alignment boundary with 2 bytes [-Werror=padded]
>
> Add explicit padding here to avoid risking information leaks
> and incompatibilities between architectures.
>
> Fixes: bb401df68c06 ("media: mali-c55: Add support for CCM")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> include/uapi/linux/media/arm/mali-c55-config.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/uapi/linux/media/arm/mali-c55-config.h b/include/uapi/linux/media/arm/mali-c55-config.h
> index 84d8f3901405..9c922290e035 100644
> --- a/include/uapi/linux/media/arm/mali-c55-config.h
> +++ b/include/uapi/linux/media/arm/mali-c55-config.h
> @@ -804,6 +804,7 @@ struct mali_c55_params_ccm {
> __u16 coeffs[3][3];
> __u16 gains[3];
> __u16 offs[3];
> + __u16 __pad;
Does this field need to be explicitly zeroed/validated anywhere the structure is
populated? Turning implicit padding into a named member fixes the layout
warning, but by itself does not seem to prevent leaking uninitialized data if
this structure is ever copied from the kernel to userspace. It might also be
worth documenting that __pad is reserved and must be zero.
I think you already checked that changing the explicit structure layout/size is
safe for existing userspace :)
> };
>
> /**
--
Regards,
Vincenzo