Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: zhangzl2013@126.com
Cc: Jay Vosburgh <jv@jvosburgh.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Hangbin Liu <liuhangbin@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Qianheng Peng <pengqh1@chinatelecom.cn>,
	Zhaolong Zhang <zhangzl68@chinatelecom.cn>
Subject: Re: [PATCH] bonding: fix devconf_all NULL dereference when IPv6 is disabled
Date: Mon, 6 Jul 2026 17:23:19 +0200	[thread overview]
Message-ID: <9e960cc8-d6c8-4f7d-9922-8d0201791ba7@lunn.ch> (raw)
In-Reply-To: <20260706084530.447402-1-zhangzl2013@126.com>

On Mon, Jul 06, 2026 at 04:45:30PM +0800, zhangzl2013@126.com wrote:
> From: Zhaolong Zhang <zhangzl68@chinatelecom.cn>
> 
> When booting with the 'ipv6.disable=1' parameter, the devconf_all is
> never initialized because inet6_init() exits before addrconf_init() is
> called which initializes it. bond_send_validate(), however, will still
> call bond_ns_send_all() even ipv6 is indeed disabled. It will lead to
> NULL derefence of net->ipv6.devconf_all in ip6_pol_route().
> 
>  BUG: kernel NULL pointer dereference, address: 000000000000000c
>  [...]
>  Workqueue: bond0 bond_arp_monitor [bonding]
>  RIP: 0010:ip6_pol_route+0x69/0x480
>  [...]
>  Call Trace:
>   <TASK>
>   ? srso_return_thunk+0x5/0x5f
>   ? __pfx_ip6_pol_route_output+0x10/0x10
>   fib6_rule_lookup+0xfe/0x260
>   ? wakeup_preempt+0x8a/0x90
>   ? srso_return_thunk+0x5/0x5f
>   ? srso_return_thunk+0x5/0x5f
>   ? sched_balance_rq+0x369/0x810
>   ip6_route_output_flags+0xd7/0x170
>   bond_ns_send_all+0xde/0x280 [bonding]
>   bond_ab_arp_probe+0x296/0x320 [bonding]
>   ? srso_return_thunk+0x5/0x5f
>   bond_activebackup_arp_mon+0xb4/0x2c0 [bonding]
>   process_one_work+0x196/0x370
>   worker_thread+0x1af/0x320
>   ? srso_return_thunk+0x5/0x5f
>   ? __pfx_worker_thread+0x10/0x10
>   kthread+0xe3/0x120
>   ? __pfx_kthread+0x10/0x10
>   ret_from_fork+0x199/0x260
>   ? __pfx_kthread+0x10/0x10
>   ret_from_fork_asm+0x1a/0x30
>   </TASK>
> 
> Fix this by adding ipv6_mod_enabled() condition check in the caller.
> 
> Fixes: 4e24be018eb9 ("bonding: add new parameter ns_targets")
> Signed-off-by: Qianheng Peng <pengqh1@chinatelecom.cn>
> Signed-off-by: Zhaolong Zhang <zhangzl68@chinatelecom.cn>

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

Please set the Subject: line correctly.

    Andrew

---
pw-bot: cr

      reply	other threads:[~2026-07-06 15:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06  8:45 [PATCH] bonding: fix devconf_all NULL dereference when IPv6 is disabled zhangzl2013
2026-07-06 15:23 ` Andrew Lunn [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=9e960cc8-d6c8-4f7d-9922-8d0201791ba7@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pengqh1@chinatelecom.cn \
    --cc=zhangzl2013@126.com \
    --cc=zhangzl68@chinatelecom.cn \
    /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