linux-stable/drivers/block
Chun-Yi Lee a16fbb8006 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:16:29 -04:00
..
aoe aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts 2024-03-26 18:16:29 -04:00
drbd drbd: actlog: fix kernel-doc warnings and spelling 2023-12-22 07:18:35 -07:00
mtip32xx block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
null_blk null_blk: Remove usage of the deprecated ida_simple_xx() API 2024-01-14 07:37:44 -07:00
rnbd block/rnbd-srv: Check for unlikely string overflow 2023-12-13 08:15:48 -07:00
xen-blkback drivers/block/xen-blkback/common.h: Fix spelling typo in comment 2024-01-04 16:10:29 -07:00
zram for-6.8/block-2024-01-08 2024-01-11 13:58:04 -08:00
Kconfig block: ublk: switch to ioctl command encoding 2023-04-18 20:13:30 -06:00
Makefile
amiflop.c amiflop: don't call fsync_bdev in FDFMTBEG 2023-08-21 14:35:31 +02:00
ataflop.c block: move bdev_mark_dead out of disk_check_media_change 2023-10-28 13:29:23 +02:00
brd.c brd: use cond_resched instead of cond_resched_rcu 2023-06-14 11:13:07 -06:00
floppy.c mm, treewide: rename MAX_ORDER to MAX_PAGE_ORDER 2024-01-08 15:27:15 -08:00
loop.c for-6.8/block-2024-01-18 2024-01-18 18:22:40 -08:00
n64cart.c
nbd.c nbd: null check for nla_nest_start 2024-03-26 18:16:27 -04:00
pktcdvd.c pktcdvd: Convert to bdev_open_by_dev() 2023-10-28 13:29:17 +02:00
ps3disk.c
ps3vram.c ps3vram: remove bio splitting 2023-01-29 15:18:35 -07:00
rbd.c rbd: don't move requests to the running list on errors 2024-01-22 00:14:10 +01:00
rbd_types.h
sunvdc.c block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00
swim.c swim: fix a missing FMODE_ -> BLK_OPEN_ conversion in floppy_open 2023-06-20 07:16:04 -06:00
swim3.c swim3: mark swim3_init() static 2023-08-10 08:32:59 -06:00
swim_asm.S
ublk_drv.c for-6.8/io_uring-2024-01-08 2024-01-11 14:19:23 -08:00
virtio_blk.c virtio-blk: Ensure no requests in virtqueues before deleting vqs. 2024-02-08 11:30:26 -07:00
xen-blkfront.c for-6.5/block-2023-06-23 2023-06-26 12:47:20 -07:00
z2ram.c block: replace fmode_t with a block-specific type for block open flags 2023-06-12 08:04:05 -06:00