Skip to content
Snippets Groups Projects
Commit 6d18b44b authored by Lin Ma's avatar Lin Ma Committed by Greg Kroah-Hartman
Browse files

media: dvbdev: adopts refcnt to avoid UAF

[ Upstream commit 0fc044b2 ]

dvb_unregister_device() is known that prone to use-after-free.
That is, the cleanup from dvb_unregister_device() releases the dvb_device
even if there are pointers stored in file->private_data still refer to it.

This patch adds a reference counter into struct dvb_device and delays its
deallocation until no pointer refers to the object.

Link: https://lore.kernel.org/linux-media/20220807145952.10368-1-linma@zju.edu.cn


Signed-off-by: default avatarLin Ma <linma@zju.edu.cn>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 438a4a8d
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment