linux/drivers/block
Chun-Yi Lee f98364e926 aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts
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>
2024-03-06 08:32:46 -07:00
..
aoe aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts 2024-03-06 08:32:46 -07:00
drbd drbd: atomically update queue limits in drbd_reconsider_queue_parameters 2024-03-06 08:30:34 -07:00
mtip32xx mtip: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:59:31 -07:00
null_blk null_blk: Delete nullb.{queue_depth, nr_queues} 2024-02-22 10:08:47 -07:00
rnbd rnbd-clt: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:59:31 -07:00
xen-blkback drivers/block/xen-blkback/common.h: Fix spelling typo in comment 2024-01-04 16:10:29 -07:00
zram zram: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:58:24 -07:00
amiflop.c block: pass a queue_limits argument to blk_mq_alloc_disk 2024-02-13 08:56:59 -07:00
ataflop.c block: pass a queue_limits argument to blk_mq_alloc_disk 2024-02-13 08:56:59 -07:00
brd.c brd: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:58:23 -07:00
floppy.c floppy: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:59:31 -07:00
Kconfig block: ublk: switch to ioctl command encoding 2023-04-18 20:13:30 -06:00
loop.c loop: use the atomic queue limits update API 2024-02-13 08:56:59 -07:00
Makefile Revert "pktcdvd: remove driver." 2023-01-04 14:44:13 -07:00
n64cart.c n64cart: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:58:24 -07:00
nbd.c nbd: use the atomic queue limits API in nbd_set_size 2024-03-01 09:08:22 -07:00
pktcdvd.c pktcdvd: don't set max_hw_sectors on the underlying device 2024-03-01 09:08:00 -07:00
ps3disk.c ps3disk: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:59:31 -07:00
ps3vram.c block: pass a queue_limits argument to blk_alloc_disk 2024-02-19 16:58:23 -07:00
rbd_types.h
rbd.c rbd: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:59:31 -07:00
sunvdc.c sunvdc: pass queue_limits to blk_mq_alloc_disk 2024-02-19 16:59:31 -07:00
swim_asm.S
swim.c block: pass a queue_limits argument to blk_mq_alloc_disk 2024-02-13 08:56:59 -07:00
swim3.c block: pass a queue_limits argument to blk_mq_alloc_disk 2024-02-13 08:56:59 -07:00
ublk_drv.c ublk: add UBLK_CMD_DEL_DEV_ASYNC 2024-02-28 18:47:08 -07:00
virtio_blk.c virtio_blk: pass queue_limits to blk_mq_alloc_disk 2024-02-13 08:56:59 -07:00
xen-blkfront.c xen-blkfront: atomically update queue limits 2024-02-27 09:33:08 -07:00
z2ram.c block: pass a queue_limits argument to blk_mq_alloc_disk 2024-02-13 08:56:59 -07:00