Re: [PATCH] ALSA: compress_offload: tighten ioctl command number checks

From: Vinod Koul
Date: Thu Jul 10 2025 - 03:46:06 EST


On 10-07-25, 08:30, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> The snd_compr_ioctl() ignores the upper 24 bits of the ioctl command
> number and only compares the number of the ioctl command, which can
> cause unintended behavior if an application tries to use an unsupprted
> command that happens to have the same _IOC_NR() value.
>
> Remove the truncation to the low bits and compare the entire ioctl
> command code like every other driver does.
>
> Fixes: b21c60a4edd2 ("ALSA: core: add support for compress_offload")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> I could not find any indication on why this driver did this in
> the first place, it already was this way in the original commit
> back in 2011.

I guess I would have started from a bad template back then!
Thanks for fixing this

Acked-by: Vinod Koul <vkoul@xxxxxxxxxx>
--
~Vinod