]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ALSA: compress_offload: tighten ioctl command number checks
authorArnd Bergmann <arnd@arndb.de>
Thu, 10 Jul 2025 06:30:49 +0000 (08:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:58:34 +0000 (08:58 +0200)
commit705164fae80c6cb0cf3dc801698e7ba1807cd491
tree2d3a346720620c186f5c243d3ec1f6710e9510bd
parent0e4683a20e1ac5f7501cfa66e0307bd49083b313
ALSA: compress_offload: tighten ioctl command number checks

[ Upstream commit 19c4096ccdd809c6213e2e62b0d4f57c880138cd ]

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@arndb.de>
Acked-by: Vinod Koul <vkoul@kernel.org>
Link: https://patch.msgid.link/20250710063059.2683476-1-arnd@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/core/compress_offload.c