From: netdev-bot+sashiko@kernel.org
To: rc4d5a@protonmail.com
Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org,
alex.aring@gmail.com, stefan@datenfreihafen.org,
miquel.raynal@bootlin.com, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net RESEND] ieee802154: 6lowpan: validate fragment offset against datagram size
Date: Thu, 12 Nov 2026 09:05:11 +0000 [thread overview]
Message-ID: <179447431152.2199510.14609873818368730049@kernel.org> (raw)
In-Reply-To: <20261109090226.799973-1-rc4d5a@protonmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The commit message overstates the security impact and
misstates the check it adds.
--
ieee802154: 6lowpan: validate fragment offset against datagram size
This commit adds a bounds check to lowpan_frag_queue() that rejects a
6LoWPAN fragment when its offset, or its offset plus length, goes past
the declared datagram size (d_size). The commit message says this stops
an attacker from forging another sender's data. It also compares the
bug to CVE-2019-8359 in Contiki-NG.
> fragment claiming to start far past the end of the datagram is
> accepted the same as a legitimate one, allowing an attacker to forge
> data of another sender.
[ ... ]
> The same class of bug was assigned CVE-2019-8359 (CVSS 9.8) in
> Contiki-NG's 6LoWPAN stack before a 2019 fix; RIOT-OS's implementation
[ ... ]
> Fix by rejecting any fragment whose offset, or offset plus length,
> falls outside [0, d_size).
[ ... ]
> diff --git a/net/ieee802154/6lowpan/reassembly.c b/net/ieee802154/6lowpan/reassembly.c
> index ddb6a5817d098..905ba5f868442 100644
> --- a/net/ieee802154/6lowpan/reassembly.c
> +++ b/net/ieee802154/6lowpan/reassembly.c
> @@ -103,6 +103,9 @@ static int lowpan_frag_queue(struct lowpan_frag_queue *fq,
> offset = lowpan_802154_cb(skb)->d_offset << 3;
> end = lowpan_802154_cb(skb)->d_size;
>
> + if (offset > end || skb->len > end - offset)
> + goto err;
> +
[Severity: Medium]
Does the commit message match what this check rejects and what it
protects against?
The check accepts offset + skb->len == end, which it has to for the
final fragment. It also accepts a zero-length FRAGN with offset ==
d_size. So the fragment end has a closed upper bound, not the
"[0, d_size)" range the message gives.
ip6_frag_queue() drops zero-length fragments:
if (end == offset)
goto discard_fq;
lowpan_frag_queue() still accepts them. They add nothing to fq->q.meat,
so they can't append any data.
About "allowing an attacker to forge data of another sender": the
message assumes the attacker can read d_tag, d_size and the addressing
in the clear. With that, can't the attacker still send an in-range
fragment at the next expected offset? For example, with d_size = 200:
FRAG1 [0, 64) legitimate, queued
FRAGN [64, 136) attacker, passes the new check
FRAGN [64, 136) legitimate, rejected as an overlap
FRAGN [136, 200) legitimate, completes the datagram
The attacker's fragment takes the append path in
inet_frag_queue_insert():
else if (FRAG_CB(last)->ip_defrag_offset + last->len < end) {
/* This is the common case: skb goes to the end. */
/* Detect and discard overlaps. */
if (offset < FRAG_CB(last)->ip_defrag_offset + last->len)
return IPFRAG_OVERLAP;
if (offset == FRAG_CB(last)->ip_defrag_offset + last->len)
fragrun_append_to_last(q, skb);
The legitimate [64, 136) fragment then gets IPFRAG_OVERLAP and is freed
through goto err in lowpan_frag_queue(). The reassembled datagram ends
up holding the attacker's bytes.
Also, 802.15.4 has no source authentication without llsec, so an
attacker can just spoof a whole datagram. This bug doesn't really enable
forging another sender's data, and the patch doesn't prevent it.
About "The same class of bug was assigned CVE-2019-8359 (CVSS 9.8)": the
Contiki-NG bug was an out-of-bounds write into a fixed reassembly
buffer. Linux never copies payload to a computed offset.
inet_frag_reasm_finish() links the fragment skbs to the head:
head->data_len += fp->len;
head->len += fp->len;
head->truesize += fp->truesize;
*nextp = fp;
So before this patch, an out-of-range offset only changed the contents
of the reassembled payload. It never touched memory outside it. Could
the comparison and the 9.8 score come out of the message? They may
mislead stable and CVE triage.
The change itself looks like a reasonable integrity and robustness fix:
a reassembled datagram can no longer contain bytes past the declared
d_size. Could the message describe it that way, and give the fragment
end's upper bound as closed?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261109090226.799973-1-rc4d5a%40protonmail.com
prev parent reply other threads:[~2026-11-12 9:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 22:32 [PATCH] " Ryan Prinz
2026-11-08 13:05 ` [PATCH RESEND] " Ryan Prinz
2026-11-08 14:20 ` [PATCH net " Ryan Prinz
2026-11-09 9:03 ` Ryan Prinz
2026-11-12 9:05 ` netdev-bot+sashiko [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=179447431152.2199510.14609873818368730049@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=alex.aring@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rc4d5a@protonmail.com \
--cc=stefan@datenfreihafen.org \
/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 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®