Re: [PATCH net v3] netrom: linearize and validate lengths in nr_rx_frame()
From: Eric Dumazet <edumazet@google.com>
Date: 2025-09-05 10:47:15
Also in:
linux-hams, lkml
From: Eric Dumazet <edumazet@google.com>
Date: 2025-09-05 10:47:15
Also in:
linux-hams, lkml
On Wed, Sep 3, 2025 at 11:19 AM Stanislav Fort [off-list ref] 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> ---
Reviewed-by: Eric Dumazet <edumazet@google.com>