Netdev List
 help / color / mirror / Atom feed
From: Fernando Fernandez Mancera <fmancera@suse.de>
To: xmei5@asu.edu, dsahern@kernel.org, idosch@nvidia.com,
	netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	kuba@kernel.org, horms@kernel.org, bestswngs@gmail.com
Subject: Re: [PATCH net] ipv6: Fix null-ptr-deref in fib6_nh_mtu_change().
Date: Fri, 19 Jun 2026 11:13:44 +0200	[thread overview]
Message-ID: <942fcca4-c20d-4c34-ae85-5ee9d34503fb@suse.de> (raw)
In-Reply-To: <20260619045334.2427073-1-xmei5@asu.edu>

On 6/19/26 6:53 AM, xmei5@asu.edu wrote:
> From: Xiang Mei <xmei5@asu.edu>
> 
> fib6_nh_mtu_change() re-fetches idev via __in6_dev_get(arg->dev) and
> dereferences idev->cnf.mtu6 without a NULL check. addrconf_ifdown()
> clears dev->ip6_ptr with RCU_INIT_POINTER() after rt6_disable_ip() has
> released tb6_lock, so the RA-driven MTU walk can observe a NULL idev and
> oops. The caller rt6_mtu_change_route() guards its own __in6_dev_get(),
> but this re-fetch is unguarded; nexthop-backed routes survive
> addrconf_ifdown()'s flush, so the walk still reaches it after ip6_ptr is
> nulled.
> 
> Return 0 when idev is NULL, matching rt6_mtu_change_route() and the
> fib6_mtu() fix in commit 5ad509c1fdad ("ipv6: Fix null-ptr-deref in
> fib6_mtu().").
> 
>    Oops: general protection fault, ... KASAN: null-ptr-deref in range
>          [0x00000000000002a8-0x00000000000002af]
>    RIP: 0010:fib6_nh_mtu_change+0x203/0x990
>     rt6_mtu_change_route+0x141/0x1d0
>     __fib6_clean_all+0xd0/0x160
>     rt6_mtu_change+0xb4/0x100
>     ndisc_router_discovery+0x24b5/0x2cb0
>     icmpv6_rcv+0x12e9/0x1710
>     ipv6_rcv+0x39b/0x410
> 
> Fixes: c0b220cf7d80 ("ipv6: Refactor exception functions")
> Reported-by: Weiming Shi <bestswngs@gmail.com>
> Assisted-by: Claude:claude-opus-4-8
> Signed-off-by: Xiang Mei <xmei5@asu.edu>

Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>

Thanks!

  reply	other threads:[~2026-06-19  9:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19  4:53 [PATCH net] ipv6: Fix null-ptr-deref in fib6_nh_mtu_change() xmei5
2026-06-19  9:13 ` Fernando Fernandez Mancera [this message]
2026-06-22  6:37 ` Ido Schimmel

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=942fcca4-c20d-4c34-ae85-5ee9d34503fb@suse.de \
    --to=fmancera@suse.de \
    --cc=bestswngs@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xmei5@asu.edu \
    /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