diff options
author | Zheng Wang <zyytlz.wz@163.com> | 2023-03-18 16:15:06 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-11 23:17:08 +0900 |
commit | d730bc84064364cafdb20c6ee7fda2cd7416407a (patch) | |
tree | a780b876e30042dfa0a867a481489195e4d07a09 /kernel/Kconfig.hz | |
parent | 35422336f5c2f6eaa58b4afbc29588d5b6dbc34d (diff) | |
download | linux-stable-d730bc84064364cafdb20c6ee7fda2cd7416407a.tar.gz linux-stable-d730bc84064364cafdb20c6ee7fda2cd7416407a.tar.bz2 linux-stable-d730bc84064364cafdb20c6ee7fda2cd7416407a.zip |
media: dm1105: Fix use after free bug in dm1105_remove due to race condition
[ Upstream commit 5abda7a16698d4d1f47af1168d8fa2c640116b4a ]
In dm1105_probe, it called dm1105_ir_init and bound
&dm1105->ir.work with dm1105_emit_key.
When it handles IRQ request with dm1105_irq,
it may call schedule_work to start the work.
When we call dm1105_remove to remove the driver, there
may be a sequence as follows:
Fix it by finishing the work before cleanup in dm1105_remove
CPU0 CPU1
|dm1105_emit_key
dm1105_remove |
dm1105_ir_exit |
rc_unregister_device |
rc_free_device |
rc_dev_release |
kfree(dev); |
|
| rc_keydown
| //use
Fixes: 34d2f9bf189c ("V4L/DVB: dm1105: use dm1105_dev & dev instead of dm1105dvb")
Signed-off-by: Zheng Wang <zyytlz.wz@163.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel/Kconfig.hz')
0 files changed, 0 insertions, 0 deletions