]> git.itanic.dy.fi Git - linux-stable/commit
media: dvb-usb: az6027: fix three null-ptr-deref in az6027_i2c_xfer()
authorWei Chen <harperchen1110@gmail.com>
Fri, 10 Mar 2023 16:56:04 +0000 (16:56 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 14 May 2023 05:29:42 +0000 (06:29 +0100)
commit858e97d7956d17a2cb56a9413468704a4d5abfe1
tree6d521428648105a5149e8aeaead11faa3a4f2006
parent0f5bb36bf9b39a2a96e730bf4455095b50713f63
media: dvb-usb: az6027: fix three null-ptr-deref in az6027_i2c_xfer()

In az6027_i2c_xfer, msg is controlled by user. When msg[i].buf is null,
commit 0ed554fd769a ("media: dvb-usb: az6027: fix null-ptr-deref in
az6027_i2c_xfer()") fix the null-ptr-deref bug when msg[i].addr is 0x99.
However, null-ptr-deref also happens when msg[i].addr is 0xd0 and 0xc0.
We add check on msg[i].len to prevent null-ptr-deref.

Link: https://lore.kernel.org/linux-media/20230310165604.3093483-1-harperchen1110@gmail.com
Signed-off-by: Wei Chen <harperchen1110@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/usb/dvb-usb/az6027.c