From: Jakub Kicinski <kuba@kernel.org>
To: Stanislav Fort <stanislav.fort@aisle.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, horms@kernel.org, linux-hams@vger.kernel.org,
linux-kernel@vger.kernel.org, security@kernel.org,
Stanislav Fort <disclosure@aisle.com>
Subject: Re: [PATCH net v3] netrom: linearize and validate lengths in nr_rx_frame()
Date: Fri, 5 Sep 2025 17:44:50 -0700 [thread overview]
Message-ID: <20250905174450.3953023d@kernel.org> (raw)
In-Reply-To: <20250903181915.6359-1-disclosure@aisle.com>
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 <disclosure@aisle.com>
> Signed-off-by: Stanislav Fort <disclosure@aisle.com>
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
prev parent reply other threads:[~2025-09-06 0:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-02 11:26 [PATCH net v2] netrom: fix out-of-bounds read in nr_rx_frame() Stanislav Fort
2025-09-02 12:17 ` Eric Dumazet
2025-09-03 18:25 ` Disclosure
2025-09-03 18:19 ` [PATCH net v3] netrom: linearize and validate lengths " Stanislav Fort
2025-09-05 10:47 ` Eric Dumazet
2025-09-06 0:44 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250905174450.3953023d@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=disclosure@aisle.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=linux-hams@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=security@kernel.org \
--cc=stanislav.fort@aisle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.