android_kernel_sony_sdm845/drivers/media
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Shigeru Yoshida 146bd005eb media: si470x: Fix use-after-free in si470x_int_in_callback()
[ Upstream commit 7d21e0b1b41b21d628bf2afce777727bd4479aa5 ]

syzbot reported use-after-free in si470x_int_in_callback() [1].  This
indicates that urb->context, which contains struct si470x_device
object, is freed when si470x_int_in_callback() is called.

The cause of this issue is that si470x_int_in_callback() is called for
freed urb.

si470x_usb_driver_probe() calls si470x_start_usb(), which then calls
usb_submit_urb() and si470x_start().  If si470x_start_usb() fails,
si470x_usb_driver_probe() doesn't kill urb, but it just frees struct
si470x_device object, as depicted below:

si470x_usb_driver_probe()
  ...
  si470x_start_usb()
    ...
    usb_submit_urb()
    retval = si470x_start()
    return retval
  if (retval < 0)
    free struct si470x_device object, but don't kill urb

This patch fixes this issue by killing urb when si470x_start_usb()
fails and urb is submitted.  If si470x_start_usb() fails and urb is
not submitted, i.e. submitting usb fails, it just frees struct
si470x_device object.

Reported-by: syzbot+9ca7a12fd736d93e0232@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?id=94ed6dddd5a55e90fd4bab942aa4bb297741d977 [1]
Signed-off-by: Shigeru Yoshida <syoshida@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-07 12:07:33 +01:00
..
common media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach() 2022-01-27 08:47:37 +01:00
dvb-core media: dmxdev: fix UAF when dvb_register_device() fails 2022-01-27 08:47:33 +01:00
dvb-frontends media: dvb-frontends: fix leak of memory fw 2023-01-07 12:07:33 +01:00
firewire media: firewire: firedtv-avc: fix a buffer overflow in avc_ca_pmt() 2022-01-29 10:15:58 +01:00
i2c media: i2c: ad5820: Fix error path 2023-01-07 12:07:16 +01:00
mmc
pci media: saa7164: fix missing pci_disable_device() 2023-01-07 12:07:19 +01:00
platform media: coda: Add check for kmalloc 2023-01-07 12:07:20 +01:00
radio media: si470x: Fix use-after-free in si470x_int_in_callback() 2023-01-07 12:07:33 +01:00
rc media: imon: fix a race condition in send_packet() 2023-01-07 12:07:17 +01:00
spi gs1662: drop kfree for memory allocated with devm_kzalloc 2017-01-26 08:24:45 +01:00
tuners media: msi001: fix possible null-ptr-deref in msi001_probe() 2022-01-27 08:47:34 +01:00
usb media: dvb-usb: fix memory leak in dvb_usb_adapter_init() 2023-01-07 12:07:33 +01:00
v4l2-core media: v4l2-dv-timings.c: fix too strict blanking sanity checks 2022-12-14 11:24:33 +01:00
cec-edid.c [media] cec-edid: check for IEEE identifier 2016-08-22 14:04:51 -03:00
Kconfig [media] media Kconfig: improve the spi integration 2016-09-19 14:37:05 -03:00
Makefile [media] Add GS1662 driver, a video serializer 2016-09-19 14:36:24 -03:00
media-device.c media: mc-device.c: don't memset __user pointer contents 2019-08-04 09:33:16 +02:00
media-devnode.c
media-entity.c media: entity: Fix stream count check 2017-07-12 15:01:02 +02:00