From: Roman Gushchin <roman.gushchin@linux.dev>
To: Eric Dumazet <edumazet@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>,
alex.aring@gmail.com, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, netdev@vger.kernel.org,
linux-wpan@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] 6lowpan: fix netdev_priv() type confusion in lowpan_event()
Date: Thu, 12 Nov 2026 20:32:56 -0800 [thread overview]
Message-ID: <87ik21ic5j.fsf@kernel.org> (raw)
In-Reply-To: <CAL4Wiiq7SweZDnbyBYAfg4rvJxowWtO_5LnB8-hnaNR2K228OQ@mail.gmail.com>
Eric Dumazet <edumazet@kernel.org> writes:
> Le ven. 6 nov. 2026 à 23:59, Roman Gushchin <roman.gushchin@linux.dev> a écrit :
>>
>> lowpan_event() assumes any netdevice with dev->type == ARPHRD_6LOWPAN
>> has a struct lowpan_dev in netdev_priv(dev). However, non-6LoWPAN
>> devices can also have ARPHRD_6LOWPAN, e.g. a TUN device via TUNSETLINK
>> or a bonding device inheriting dev->type from its lower device.
>>
>> Bringing such a device up or down causes lowpan_event() to read and
>> overwrite unrelated netdev_priv() memory. Since unprivileged users can
>> create TUN and bonding devices in a user and network namespace, they
>> can corrupt struct bonding and trigger a slab use-after-free.
>>
>> Also check dev->ndisc_ops == &lowpan_ndisc_ops, which is set only by
>> lowpan_register_netdevice() on genuine 6LoWPAN devices.
>>
>> Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
>> Fixes: 5609c185f24d ("6lowpan: iphc: add support for stateful compression")
>> Fixes: 2ad3ed59198c ("6lowpan: add 802.15.4 short addr slaac")
>> Cc: stable@vger.kernel.org
>> Reported-by: Sashiko <sashiko-bot@kernel.org>
>> Closes: https://sashiko.dev/#/bug/linux-97b284e0-576e-4373-b62f-eb132f482b91
>
> nit: Signed-off-by should come last, after Fixes:/Reported-by:/Closes:.
>
> The fix itself looks right to me: lowpan_register_netdevice() is the
> only place setting dev->ndisc_ops to &lowpan_ndisc_ops, and
> bond_setup_by_slave() does not copy ndisc_ops, so this is a reliable
> discriminator.
>
> Reviewed-by: Eric Dumazet <edumazet@kernel.org>
> Thanks.
Thank you for review!
Should I re-spin it with the correct tags order?
Thanks
next prev parent reply other threads:[~2026-11-13 4:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 22:59 [PATCH net] 6lowpan: fix netdev_priv() type confusion in lowpan_event() Roman Gushchin
2026-11-06 23:02 ` netdev-bot+sinfo
2026-11-06 23:10 ` Roman Gushchin
2026-11-06 23:50 ` Eric Dumazet
2026-11-13 4:32 ` Roman Gushchin [this message]
2026-11-07 2:29 ` [net] " bluez.test.bot
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=87ik21ic5j.fsf@kernel.org \
--to=roman.gushchin@linux.dev \
--cc=alex.aring@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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.