public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] net: fix three security bugs in NET/ROM and ROSE stacks
@ 2026-04-07 17:15 Mashiro Chen
  2026-04-07 17:15 ` [PATCH 1/3] net: netrom: fix integer overflow in nr_queue_rx_frame() Mashiro Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mashiro Chen @ 2026-04-07 17:15 UTC (permalink / raw)
  To: netdev
  Cc: davem, edumazet, kuba, pabeni, horms, gregkh, ben, linux-hams,
	linux-kernel, stable, Mashiro Chen

This series fixes three bugs in the Linux kernel AX.25 protocol stack,
submitted on top of Greg Kroah-Hartman's frame-size validation series
(https://lore.kernel.org/r/2026040730-untagged-groin-bbb7@gregkh).

Patch 1 fixes an integer overflow in nr_queue_rx_frame(): nr_sock.fraglen
is declared as unsigned short and accumulates received fragment lengths
without overflow protection.  When total received data exceeds 65535 bytes,
fraglen wraps to a small value, causing alloc_skb() to allocate a tiny
buffer followed by a full-length copy -- a heap out-of-bounds write.

Patch 2 fixes nr_find_socket() dispatching incoming NR_INFO frames by
matching only the circuit index/id bytes without validating the source
callsign against the socket's dest_addr.  Any node can inject frames into
an existing STATE_3 connection by guessing the circuit ID (the value space
is only 65025 non-zero pairs and IDs are assigned sequentially).  Combined
with the fraglen overflow in patch 1, this gives an unauthenticated
attacker a complete heap corruption primitive.

Patch 3 fixes an out-of-bounds read in rose_parse_ccitt(): the function
validates 10 <= l <= 20 but never checks that the remaining buffer is at
least l+2 bytes before calling memcpy().  rose_parse_national() already
performs the equivalent check; this patch adds the same guard.

Mashiro Chen (3):
  net: netrom: fix integer overflow in nr_queue_rx_frame()
  net: netrom: validate source address in nr_find_socket()
  net: rose: fix out-of-bounds read in rose_parse_ccitt()

 net/netrom/af_netrom.c | 11 +++++++----
 net/netrom/nr_in.c     | 10 ++++++++++
 net/rose/rose_subr.c   |  3 +++
 3 files changed, 20 insertions(+), 4 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-04-07 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 17:15 [PATCH 0/3] net: fix three security bugs in NET/ROM and ROSE stacks Mashiro Chen
2026-04-07 17:15 ` [PATCH 1/3] net: netrom: fix integer overflow in nr_queue_rx_frame() Mashiro Chen
2026-04-07 17:15 ` [PATCH 2/3] net: netrom: validate source address in nr_find_socket() Mashiro Chen
2026-04-07 17:16 ` [PATCH 3/3] net: rose: fix out-of-bounds read in rose_parse_ccitt() Mashiro Chen

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