WSL2-Linux-Kernel/include
Hyunwoo Kim a47a3f7a9b media: dvb-core: Fix use-after-free due to race at dvb_register_device()
[ Upstream commit 627bb528b0 ]

dvb_register_device() dynamically allocates fops with kmemdup()
to set the fops->owner.
And these fops are registered in 'file->f_ops' using replace_fops()
in the dvb_device_open() process, and kfree()d in dvb_free_device().

However, it is not common to use dynamically allocated fops instead
of 'static const' fops as an argument of replace_fops(),
and UAF may occur.
These UAFs can occur on any dvb type using dvb_register_device(),
such as dvb_dvr, dvb_demux, dvb_frontend, dvb_net, etc.

So, instead of kfree() the fops dynamically allocated in
dvb_register_device() in dvb_free_device() called during the
.disconnect() process, kfree() it collectively in exit_dvbdev()
called when the dvbdev.c module is removed.

Link: https://lore.kernel.org/linux-media/20221117045925.14297-4-imv4bel@gmail.com
Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-09 10:32:24 +02:00
..
acpi
asm-generic asm-generic/io.h: suppress endianness warnings for readq() and writeq() 2023-05-11 23:00:15 +09:00
clocksource
crypto crypto: api - Add scaffolding to change completion function signature 2023-05-17 11:50:20 +02:00
drm drm/bridge: Fix returned array size name for atomic_get_input_bus_fmts kdoc 2023-03-22 13:31:26 +01:00
dt-bindings clk: imx8mn: rename vpu_pll to m7_alt_pll 2022-12-31 13:14:12 +01:00
keys
kunit
kvm
linux power: supply: core: Refactor power_supply_set_input_current_limit_from_supplier() 2023-06-05 09:21:13 +02:00
math-emu
media media: dvb-core: Fix use-after-free due to race at dvb_register_device() 2023-06-09 10:32:24 +02:00
memory
misc
net tcp: deny tcp_disconnect() when threads are waiting 2023-06-09 10:32:17 +02:00
pcmcia
ras
rdma
scsi scsi: iscsi_tcp: Fix UAF during logout when accessing the shost ipaddress 2023-02-09 11:26:39 +01:00
soc
sound ASoC: soc-pcm: Fix DPCM lockdep warning due to nested stream locks 2023-05-17 11:50:26 +02:00
target scsi: target: Fix multiple LUN_RESET handling 2023-05-11 23:00:26 +09:00
trace SUNRPC: Remove svc_rqst::rq_xprt_hlen 2023-05-24 17:36:50 +01:00
uapi ipv{4,6}/raw: fix output xfrm lookup wrt protocol 2023-06-05 09:21:26 +02:00
vdso
video
xen ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 2023-05-11 23:00:22 +09:00