Thread (6 messages) 6 messages, 4 authors, 2025-09-06

Re: [PATCH net v3] netrom: linearize and validate lengths in nr_rx_frame()

From: Jakub Kicinski <kuba@kernel.org>
Date: 2025-09-06 00:44:52
Also in: linux-hams, lkml

On Wed,  3 Sep 2025 21:19:15 +0300 Stanislav Fort wrote:
Linearize skb and add targeted length checks in nr_rx_frame() to avoid out-of-bounds reads and potential use-after-free when processing malformed NET/ROM frames.

- Linearize skb and require at least NR_NETWORK_LEN + NR_TRANSPORT_LEN (20 bytes) before reading network/transport fields.
- For existing sockets path, ensure NR_CONNACK includes the window byte (>= 21 bytes).
- For CONNREQ handling, ensure window (byte 20) and user address (bytes 21-27) are present (>= 28 bytes).
- Maintain existing BPQ extension handling:
  - NR_CONNACK len == 22 implies 1 extra byte (TTL)
  - NR_CONNREQ len == 37 implies 2 extra bytes (timeout)

Suggested-by: Eric Dumazet <edumazet@google.com>
Reported-by: Stanislav Fort <redacted>
Signed-off-by: Stanislav Fort <redacted>
Thanks for the fix! The commit message needs a bit of touching up..

Please wrap it at 74 chars.

Please add a Fixes tag pointing to the commit which introduced the
bugs. Quite possibly Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") in area
of the code base.

Please remove the Reported-by:, it's implicit that the author discovered
the bug if no explicit reported-by tag is provided.

Please add the review tag from Eric when reposting.
-- 
pw-bot: cr
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help