]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
media: bt878: do not schedule tasklet when it is not setup
authorTong Zhang <ztong0001@gmail.com>
Wed, 28 Apr 2021 22:12:26 +0000 (00:12 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:30:02 +0000 (09:30 +0200)
commitc4a289ec22552b0435fb8a827fe01dd907cce39c
tree8b70de2812798a5865dc02a3325dfdc4ae925705
parentfd1634a0bfb10e8dda8b824e692e8b5de4bdcf3a
media: bt878: do not schedule tasklet when it is not setup

BugLink: https://bugs.launchpad.net/bugs/1938340
[ Upstream commit a3a54bf4bddaecda8b5767209cfc703f0be2841d ]

There is a problem with the tasklet in bt878. bt->tasklet is set by
dvb-bt8xx.ko, and bt878.ko can be loaded independently.
In this case if interrupt comes it may cause null-ptr-dereference.
To solve this issue, we check if the tasklet is actually set before
calling tasklet_schedule.

[    1.750438] bt878(0): irq FDSR FBUS risc_pc=
[    1.750728] BUG: kernel NULL pointer dereference, address: 0000000000000000
[    1.752969] RIP: 0010:0x0
[    1.757526] Call Trace:
[    1.757659]  <IRQ>
[    1.757770]  tasklet_action_common.isra.0+0x107/0x110
[    1.758041]  tasklet_action+0x22/0x30
[    1.758237]  __do_softirq+0xe0/0x29b
[    1.758430]  irq_exit_rcu+0xa4/0xb0
[    1.758618]  common_interrupt+0x8d/0xa0
[    1.758824]  </IRQ>

Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/media/pci/bt8xx/bt878.c