]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
media: usb: dvd-usb: fix uninit-value bug in dibusb_read_eeprom_byte()
authorAnant Thazhemadam <anant.thazhemadam@gmail.com>
Mon, 7 Dec 2020 06:16:06 +0000 (07:16 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:15 +0000 (09:48 +0100)
commit93e598f27ae2dd773ee15d2a3ce4f629183b321c
tree4c8ded47257a3f369b6e23c7fa42efe8ea608852
parentf847795cb86842c3b8f0d8a125a32d48be89fe0f
media: usb: dvd-usb: fix uninit-value bug in dibusb_read_eeprom_byte()

BugLink: https://bugs.launchpad.net/bugs/1951822
[ Upstream commit 899a61a3305d49e8a712e9ab20d0db94bde5929f ]

In dibusb_read_eeprom_byte(), if dibusb_i2c_msg() fails, val gets
assigned an value that's not properly initialized.
Using kzalloc() in place of kmalloc() for the buffer fixes this issue,
as the val can now be set to 0 in the event dibusb_i2c_msg() fails.

Reported-by: syzbot+e27b4fd589762b0b9329@syzkaller.appspotmail.com
Tested-by: syzbot+e27b4fd589762b0b9329@syzkaller.appspotmail.com
Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/media/usb/dvb-usb/dibusb-common.c