mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v3 0/1] netdevsim: fix the inverted queue count check in flow control
@ 2026-11-30  5:56 Kyuwon Cho
  2026-11-30  5:56 ` [PATCH net v3 1/1] " Kyuwon Cho
  0 siblings, 1 reply; 2+ messages in thread
From: Kyuwon Cho @ 2026-11-30  5:56 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
	Breno Leitao, Willem de Bruijn, Jiayuan Chen, netdev,
	linux-kernel

nsim_start_peer_tx_queue() can wake a TX queue past the end of the
peer's TX queue array after the device is relinked to a peer with fewer
TX queues; KASAN reports a slab-out-of-bounds read in nsim_poll(). The
cause is that the queue count checks in nsim_start_peer_tx_queue() and
nsim_stop_tx_queue() compare the RX device's TX queues with the TX
device's RX queues. The patch compares the right pair, which also keeps
the woken queue inside the peer's TX queue array.

v3: fix the comparison in both functions instead of bounding the index
    (Willem). Jiayuan's Reviewed-by is dropped because the fix changed.
v2: https://lore.kernel.org/netdev/179528809256.2009509.5007624677973207521@gmail.com/
    send the patch inline instead of as an attachment (Jakub).
v1: https://lore.kernel.org/netdev/179505710275.3511681.13434978152402269948@gmail.com/

The issue was found by an LLM-guided test generator that we are
developing as a research prototype. With the patch, the reproducer from
v1 no longer triggers the KASAN report. Tested on net e2fb9368a416.

Kyuwon Cho (1):
  netdevsim: fix the inverted queue count check in flow control

 drivers/net/netdevsim/netdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-11-30  5:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30  5:56 [PATCH net v3 0/1] netdevsim: fix the inverted queue count check in flow control Kyuwon Cho
2026-11-30  5:56 ` [PATCH net v3 1/1] " Kyuwon Cho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®