All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTS Backport Request] Fix RSS indirection table OOB write (6.1.y, 6.6.y)
@ 2026-06-30  0:51 Annie Kim
  2026-06-30 22:23 ` Sasha Levin
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Annie Kim @ 2026-06-30  0:51 UTC (permalink / raw)
  To: stable; +Cc: mst, jasowang@redhat.com

Hello,

Hope this email finds you well. (Sorry I am resending it due to plaintext issue)

I am reporting a minor OOB write bug that was fixed in the mainline
kernel (commit c7114b1249fa) but is still missing from the stable LTS
trees (6.1.y, 6.6.y)
  - the fix: https://github.com/torvalds/linux/commit/86a48a00efdf61197b6658e52c6140463eb313dc
Please excuse me if this issue has already been acknowledged or deemed
non-critical. However, I am reporting it because this OOB write could
still be exploited by a malicious device or host OS to trigger
unexpected behavior in the guest VM.

Bug:
- drivers/net/virtio_net.c reads rss_max_indirection_table_length from
device config with no bound check, then uses it as a loop bound over a
fixed 128-entry array (indirection table) embedded in a kmalloc-512
buffer.
- A malicious device/hostOS can OOB write past the indirection table.
- Confirmed KASAN output (virtnet_init_default_rss is inlined into
virtnet_probe):
  BUG: KASAN: slab-out-of-bounds in virtnet_probe+0x2f46/0x3bc0
  Write of size 2 at addr ff110000bb9aed68 by task swapper/0/1

Impact:
most likely just guest kernel crash.
- At boot if the virtio-net device config reports
rss_max_indirection_table_length > 128, with values constrained to to
0..N-1 where N is the maximum number of vCPUs for the VM. (OOB write)
- At runtime if the guest runs "ethtool -X" on the buggy device.
Again, values are constrained to N. (OOB write, OOB read)

Exact files and affected code:
(Line numbers below are from 6.6.y (6.1.y is equivalent).)
drivers/net/virtio_net.c:223  #define VIRTIO_NET_RSS_MAX_TABLE_LEN 128
drivers/net/virtio_net.c:228  u16
indirection_table[VIRTIO_NET_RSS_MAX_TABLE_LEN];   (fixed-size array)
drivers/net/virtio_net.c:4816 vi->rss_indir_table_size =
virtio_cread16(... rss_max_indirection_table_length)   (unchecked
read)
drivers/net/virtio_net.c:3204 vi->ctrl->rss.indirection_table[i] =
indir_val;   (OOB write when size > 128, boot path)
drivers/net/virtio_net.c:3883 vi->ctrl->rss.indirection_table[i] =
rxfh->indir[i];   (OOB write, ethtool set_rxfh path)


Affected:
Trees containing c7114b1249fa (v5.18) but predating the fix (v6.13).
Confirmed by source inspection: 6.1.y, 6.6.y. Not affected: 6.12.y and
later (already fixed), 5.15.y and older (no virtio-net RSS).

To reproduce (I can send you the PoC if you need it):
Guest OS with VIRTIO_NET_F_RSS and UBSAN/KASAN; make QEMU return 512
for rss_max_indirection_table_length in virtio_net_get_config(); boot
triggers an out-of-bounds write report in virtnet_init_default_rss().

Proposed fix:
The canonical fix is the upstream commit 86a48a00efdf, which makes the
indirection table dynamically sized. Please apply 86a48a00efdf to
6.6.y and 6.1.y.

Thanks,
Annie Kim

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-08-21  4:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-30  0:51 [LTS Backport Request] Fix RSS indirection table OOB write (6.1.y, 6.6.y) Annie Kim
2026-06-30 22:23 ` Sasha Levin
2026-07-03 10:50   ` [PATCH 6.6.y] virtio_net: clamp rss_indir_table_size to VIRTIO_NET_RSS_MAX_TABLE_LEN Hyokyung Kim
2026-07-04  2:05     ` Sasha Levin
2026-07-06  5:48       ` Annie Kim
2026-07-03 10:52   ` [PATCH 6.1.y] " Hyokyung Kim
2026-08-20 13:49     ` Greg KH
2026-08-21  4:33       ` Sasha Levin
2026-07-10 11:19 ` [PATCH 6.6.y] virtio_net: Support dynamic rss indirection table size Hyokyung Kim
2026-07-10 21:03   ` Sasha Levin
2026-07-10 11:25 ` [PATCH 6.1.y] " Hyokyung Kim
2026-07-10 21:03   ` Sasha Levin
2026-07-10 12:49 ` [PATCH 6.6.y] " Hyokyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.