Commit bff0a475 authored by Wei Chen's avatar Wei Chen Committed by sanglipeng
Browse files

media: dvb-usb: az6027: fix three null-ptr-deref in az6027_i2c_xfer()

stable inclusion
from stable-v5.10.183
commit 084e43d9a4c19defff5af848a697be8964704103
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8IRR2

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=084e43d9a4c19defff5af848a697be8964704103

--------------------------------

[ Upstream commit 858e97d7 ]

In az6027_i2c_xfer, msg is controlled by user. When msg[i].buf is null,
commit 0ed554fd ("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: default avatarWei Chen <harperchen1110@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 43949b2d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment