linux-stable/drivers/block
Chun-Yi Lee 74ca3ef68d 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:20:29 -04:00
..
aoe aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts 2024-03-26 18:20:29 -04:00
drbd drbd: correctly submit flush bio on barrier 2023-05-11 23:03:39 +09:00
mtip32xx block: move from strlcpy with unused retval to strscpy 2022-09-21 19:45:04 -06:00
null_blk null_blk: don't cap max_hw_sectors to BLK_DEF_MAX_SECTORS 2024-01-25 15:27:30 -08:00
paride block: Change the type of req_op() and bio_op() into enum req_op 2022-07-14 12:14:30 -06:00
rnbd block/rnbd-srv: Check for unlikely string overflow 2024-02-05 20:12:52 +00:00
xen-blkback xen: branch for v6.0-rc4 2022-09-03 13:23:11 -07:00
zram - Alistair Popple has a series which addresses a race which causes page 2022-10-14 12:28:43 -07:00
Kconfig ublk_drv: comment on ublk_driver entry of Kconfig 2022-10-31 07:23:24 -06:00
Makefile remove the sx8 block driver 2022-08-02 17:22:46 -06:00
amiflop.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
ataflop.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
brd.c brd: use radix_tree_maybe_preload instead of radix_tree_preload 2023-03-10 09:34:34 +01:00
floppy.c floppy: Fix memory leak in do_floppy_init() 2022-12-31 13:33:11 +01:00
loop.c loop: fix the the direct I/O support check when used on top of block devices 2024-01-25 15:27:51 -08:00
n64cart.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
nbd.c nbd: null check for nla_nest_start 2024-03-26 18:20:28 -04:00
pktcdvd.c pktcdvd: check for NULL returna fter calling bio_split_to_limits() 2023-01-24 07:24:37 +01:00
ps3disk.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
ps3vram.c block: handle bio_split_to_limits() NULL return 2023-01-18 11:58:33 +01:00
rbd.c rbd: don't move requests to the running list on errors 2024-01-31 16:17:07 -08:00
rbd_types.h
sunvdc.c block: sunvdc: add check for mdesc_grab() returning NULL 2023-03-22 13:33:47 +01:00
swim.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
swim3.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00
swim_asm.S
ublk_drv.c ublk: move ublk_cancel_dev() out of ub->mutex 2024-01-01 12:39:06 +00:00
virtio_blk.c virtio-blk: Ensure no requests in virtqueues before deleting vqs. 2024-03-01 13:26:30 +01:00
xen-blkfront.c xen/blkfront: Only check REQ_FUA for writes 2023-06-21 16:00:53 +02:00
z2ram.c block: remove blk_cleanup_disk 2022-06-28 06:33:15 -06:00