From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 728CA44683E; Thu, 30 Jul 2026 15:05:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785423934; cv=none; b=CeXT/tCQqTV+BBnl0OT335CKyj+zz+nSZmDkSpLHcskxpvKLu5DJKo2ee0zhRYNXUUGT7Xna7NrmtQFf7Ds5YUdOD50DIMaTlMA4yyncfzBaRh4hUbOKSDTV1mcSMGju9cs2GQNGl4YQQ0CMrqFqbw77JeY2nu4cslMGer3460w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785423934; c=relaxed/simple; bh=ydQx/k/fkY4MEtZJTrYIyXDJCaG1ADpR59qdPq4V2JM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nirZY27rycZM4ev/cN9pAxsRcpuQb9ZAFMu0hnhXNHv+NFnQoEVmYfz5Q6TT4iercHZ7YjECanX0UfqIaAiW6fjHIuHCngDDGQn5Rs9fhnSYqW4WZhnMzyV+tFJlTQSuBZmDt4UTvbCMDpbaWnM1ugeOfx7pnPJWfhmzorbKLoA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YFrhzhk4; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YFrhzhk4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB1F71F00A3A; Thu, 30 Jul 2026 15:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785423933; bh=iiyd+295C4tnmcTd7wfelFTSJlZN9vR3StfFVwXRfNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=YFrhzhk4u9AUoZ6jMDTR4G2SmnbZ1ccdSNsi3mnxe3VqdwRBjH+qJnHGIVbEU/sHA d2CjD/gpwqHtHA1y38P1bONdqDGvwe1WL80u4f807VNCMwRDSleAKXhxrvIvpns3MM ru6IiX3Od2nSoGsnQuCKxPlX6ffjOcNtc48BgGaE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Qianheng Peng , Zhaolong Zhang , Hangbin Liu , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.18 215/675] bonding: fix devconf_all NULL dereference when IPv6 is disabled Date: Thu, 30 Jul 2026 16:09:05 +0200 Message-ID: <20260730141449.711074362@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141445.110192266@linuxfoundation.org> References: <20260730141445.110192266@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhaolong Zhang [ Upstream commit 1c975de3343cdef506f2eecc833cc1f14b0401c4 ] 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: ? 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 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 Signed-off-by: Zhaolong Zhang Reviewed-by: Hangbin Liu Link: https://patch.msgid.link/20260707010622.487333-1-zhangzl2013@126.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/bonding/bond_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e38cae22fe025e..52af663e12e0c1 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3422,7 +3422,8 @@ static void bond_send_validate(struct bonding *bond, struct slave *slave) { bond_arp_send_all(bond, slave); #if IS_ENABLED(CONFIG_IPV6) - bond_ns_send_all(bond, slave); + if (likely(ipv6_mod_enabled())) + bond_ns_send_all(bond, slave); #endif } -- 2.53.0