linux-stable/drivers/block
Chun-Yi Lee faf0b4c5e0 aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts
[ Upstream commit f98364e926 ]

This patch is against CVE-2023-6270. The description of cve is:

  A flaw was found in the ATA over Ethernet (AoE) driver in the Linux
  kernel. The aoecmd_cfg_pkts() function improperly updates the refcnt on
  `struct net_device`, and a use-after-free can be triggered by racing
  between the free on the struct and the access through the `skbtxq`
  global queue. This could lead to a denial of service condition or
  potential code execution.

In aoecmd_cfg_pkts(), it always calls dev_put(ifp) when skb initial
code is finished. But the net_device ifp will still be used in
later tx()->dev_queue_xmit() in kthread. Which means that the
dev_put(ifp) should NOT be called in the success path of skb
initial code in aoecmd_cfg_pkts(). Otherwise tx() may run into
use-after-free because the net_device is freed.

This patch removed the dev_put(ifp) in the success path in
aoecmd_cfg_pkts(), and added dev_put() after skb xmit in tx().

Link: https://nvd.nist.gov/vuln/detail/CVE-2023-6270
Fixes: 7562f876cd ("[NET]: Rework dev_base via list_head (v3)")
Signed-off-by: Chun-Yi Lee <jlee@suse.com>
Link: https://lore.kernel.org/r/20240305082048.25526-1-jlee@suse.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:21:48 -04:00
..
aoe aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts 2024-03-26 18:21:48 -04:00
drbd drbd: correctly submit flush bio on barrier 2023-05-17 11:48:18 +02:00
mtip32xx
null_blk null_blk: Always check queue mode setting from configfs 2023-05-30 12:57:49 +01:00
paride
rnbd block/rnbd-srv: Check for unlikely string overflow 2024-02-23 08:42:08 +01:00
rsxx block: rsxx: fix error return code of rsxx_pci_probe() 2021-03-17 17:06:33 +01:00
xen-blkback xen-blkback: Advertise feature-persistent as user requested 2022-09-08 11:11:39 +02:00
zram zram: do not lookup algorithm in backends table 2022-08-25 11:38:14 +02:00
Kconfig remove the sx8 block driver 2023-06-14 11:09:30 +02:00
Makefile remove the sx8 block driver 2023-06-14 11:09:30 +02:00
amiflop.c
ataflop.c block: ataflop: more blk-mq refactoring fixes 2024-03-01 13:16:51 +01:00
brd.c brd: return 0/-error from brd_insert_page() 2023-03-11 16:39:59 +01:00
cryptoloop.c cryptoloop: add a deprecation warning 2021-09-08 08:49:01 +02:00
floppy.c floppy: use a statically allocated error counter 2022-05-25 09:17:51 +02:00
loop.c loop: Select I/O scheduler 'none' from inside add_disk() 2023-08-11 11:57:46 +02:00
loop.h
nbd.c nbd: null check for nla_nest_start 2024-03-26 18:21:47 -04:00
pktcdvd.c
ps3disk.c
ps3vram.c
rbd.c rbd: don't move requests to the running list on errors 2024-02-23 08:41:58 +01:00
rbd_types.h
skd_main.c skd_main: remove unused including <linux/version.h> 2020-10-17 08:11:14 -06:00
skd_s1120.h
sunvdc.c block: sunvdc: add check for mdesc_grab() returning NULL 2023-03-22 13:29:59 +01:00
swim.c
swim3.c
swim_asm.S
umem.c umem: fix error return code in mm_pci_probe() 2021-03-30 14:31:50 +02:00
umem.h
virtio_blk.c virtio-blk: Ensure no requests in virtqueues before deleting vqs. 2024-03-01 13:16:45 +01:00
xen-blkfront.c xen/blkfront: Only check REQ_FUA for writes 2023-06-21 15:45:36 +02:00
xsysace.c xsysace: use platform_get_resource() and platform_get_irq_optional() 2020-10-29 08:22:33 -06:00
z2ram.c