From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Sung Byeongchan <tjdqudcks0424@naver.com>
Cc: Alexander Aring <alex.aring@gmail.com>,
Stefan Schmidt <stefan@datenfreihafen.org>,
linux-wpan@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] ieee802154: require CAP_NET_ADMIN for SIOCSIFADDR
Date: Tue, 17 Nov 2026 10:24:05 +0100 [thread overview]
Message-ID: <87jymboloq.fsf@bootlin.com> (raw)
In-Reply-To: <20261107093601.619363-1-tjdqudcks0424@naver.com> (Sung Byeongchan's message of "Sat, 7 Nov 2026 18:36:01 +0900")
On 07/11/2026 at 18:36:01 +09, Sung Byeongchan <tjdqudcks0424@naver.com> wrote:
> PF_IEEE802154 DGRAM sockets are available to ordinary init-net processes.
> Their family-specific SIOCSIFADDR path calls the netdev ioctl directly and
> does not pass through the generic network-device setter capability check.
> An unprivileged process can therefore change the PAN ID and short address
> of a separately administrator-owned down WPAN interface.
>
> In a local fakelb fixture, uid 1000 changed both identifiers and the values
> remained active through a later administrator interface open in three of
> three fresh KASAN boots.
>
> Require CAP_NET_ADMIN in the socket network namespace before processing
> SIOCSIFADDR. Keep SIOCGIFADDR and all existing state and value checks
> unchanged.
>
> The fixed kernel rejected the same unprivileged request with -EPERM and
> preserved the administrator identity in three of three matched boots.
> Administrator SET, running-device, invalid-value, wrong-device, cleanup,
> later-open and recovery controls passed in all baseline and fixed runs.
>
> The demonstrated impact is local cross-principal WPAN identity and policy
> modification after privileged device setup. Memory corruption, disclosure,
> RCE and LPE were not demonstrated.
>
> Fixes: 9ec767160357 ("net: add IEEE 802.15.4 socket family
> implementation")
Probably a good stable candidate,
Cc: stable@vger.kernel.org
> Assisted-by: OpenAI Codex
>
Nit: extra line
> Signed-off-by: Sung Byeongchan <tjdqudcks0424@naver.com>
> ---
> net/ieee802154/socket.c | 4 ++++
> 1 file changed, 4 insertions(+)
> diff --git a/net/ieee802154/socket.c b/net/ieee802154/socket.c
> index be8ca1f053a2b..362457de8424c 100644
> --- a/net/ieee802154/socket.c
> +++ b/net/ieee802154/socket.c
> @@ -128,6 +128,10 @@ static int ieee802154_dev_ioctl(struct sock *sk, struct ifreq __user *arg,
> int ret = -ENOIOCTLCMD;
> struct net_device *dev;
>
> + if (cmd == SIOCSIFADDR &&
> + !ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
> + return -EPERM;
> +
> if (get_user_ifreq(&ifr, NULL, arg))
> return -EFAULT;
The fix is correct, but since you are aligning those checks with other
path (like IPv4) maybe for the sake of coherency, those checks should be
done in the same order. An unpriviledged user providing an incorrect
device would get EPERM instead of EFAULT in devinet_ioctl(). Not sure if
that's worth a respin though. In any case,
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
prev parent reply other threads:[~2026-11-17 9:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 9:36 [PATCH] ieee802154: require CAP_NET_ADMIN for SIOCSIFADDR Sung Byeongchan
2026-11-07 9:41 ` netdev-bot+sinfo
2026-11-17 9:24 ` Miquel Raynal [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=87jymboloq.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=alex.aring@gmail.com \
--cc=linux-wpan@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stefan@datenfreihafen.org \
--cc=tjdqudcks0424@naver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox