]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: dvb-frontends: w7090p: fix null-ptr-deref in w7090p_tuner_write_serpar and...
authorAlex Guo <alexguo1023@gmail.com>
Mon, 16 Jun 2025 01:33:53 +0000 (21:33 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:01 +0000 (16:26 +0200)
commit454a443eaa792c8865c861a282fe6d4f596abc3a
tree2de2d4db7b5fa6bd00e634c82f286b5103e5b739
parentc33280d6bd668dbdc5a5f07887cc63a52ab4789c
media: dvb-frontends: w7090p: fix null-ptr-deref in w7090p_tuner_write_serpar and w7090p_tuner_read_serpar

[ Upstream commit ed0234c8458b3149f15e496b48a1c9874dd24a1b ]

In w7090p_tuner_write_serpar, msg is controlled by user. When msg[0].buf is null and msg[0].len is zero, former checks on msg[0].buf would be passed. If accessing msg[0].buf[2] without sanity check, null pointer deref would happen. We add
check on msg[0].len to prevent crash.

Similar commit: commit 0ed554fd769a ("media: dvb-usb: az6027: fix null-ptr-deref in az6027_i2c_xfer()")

Signed-off-by: Alex Guo <alexguo1023@gmail.com>
Link: https://lore.kernel.org/r/20250616013353.738790-1-alexguo1023@gmail.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/dvb-frontends/dib7000p.c