Re: [PATCH] media: atomisp: reject short _DSM packages
From: Dan Carpenter
Date: Tue Nov 03 2026 - 09:19:30 EST
On Tue, Nov 03, 2026 at 07:41:21PM +0800, Kang Chen wrote:
> gmin_get_config_dsm_var() walks the package returned by the atomisp
> _DSM function, but it does not reject packages with fewer than two
> elements. count is unsigned, so an empty package makes count - 1
> evaluate to UINT_MAX and the loop walks far past the end of the
> elements array, reading unrelated memory.
>
> Require at least two elements before scanning the key/value pairs.
>
> Fixes: 387041cda44e ("media: atomisp: improve sensor detection code to use _DSM table")
> Signed-off-by: Kang Chen <k.chen@xxxxxxxxxxxxxxxx>
> ---
Surely, the infromation from ACPI is trusted?
regards,
dan carpenter