From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dvalin.narfation.org (dvalin.narfation.org [213.160.73.56]) (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 F1531400DFE for ; Fri, 29 May 2026 18:11:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.160.73.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780078303; cv=none; b=a4gImEqyoXLMLd0siTOoq973UU3Tp+E8/sJYhBXk8jc4gGJhGhu6nMR/lL6xA8VEVp40J+O6dJaeYwOrQgEkgTJ4OwGMqgFzmrh4x856SSwMjDofxh0SroqmKN6JvZjB7apCpSFWCtsqLFXtfuRywYeHKzAJiAkalynPNRuh8Rc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780078303; c=relaxed/simple; bh=ukkKVaBq1sd3BayR0TENJONdq5x3QZn5Q7+5CwvsW0s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s/U03ugCAO3JwbVvuZWX5v9eIUNE1+yM0FmBfUx9qMfEai2ye3EFXWuvzw56Nm0nHJfIIs5otutePOZvztuyzylNYFqneCKL7pQCqdmqgnpSupthHIlT8NcetXz5HMklMpWJooXCM67QlmowMETqPlQ95Bq6zL/EupyEy3u4dYE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=narfation.org; spf=pass smtp.mailfrom=narfation.org; dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.b=AEO6QYV6; arc=none smtp.client-ip=213.160.73.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=narfation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=narfation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.b="AEO6QYV6" Received: by dvalin.narfation.org (Postfix) id D1F1F2000E; Fri, 29 May 2026 18:11:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1780078294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SpZYQ8uHpVpIxTS6a5T3KCFnceMjG3xK90N97AucqZY=; b=AEO6QYV6cl+cf29GcD77dzLcl2FG6wvJmj25zN3/EhY6c5VK47gJraSB5T6KxeXlthvx33 /XqTFPX715h9spym3S17i899ELeGKyDtqprRhG58KaSbcZJlKnbUVLqdoqynkcZSPxbuKP 6pqLpStA5Yi58KEXb8s5TWpT0ltGz+E= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann , stable@kernel.org, Ido Schimmel , syzbot+9fdcc9f05a98a540b816@syzkaller.appspotmail.com Subject: [PATCH 6.12.y] batman-adv: bla: avoid NULL-ptr deref for claim via dropped interface Date: Fri, 29 May 2026 20:11:25 +0200 Message-ID: <20260529181125.415543-1-sven@narfation.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <2026052808-zit-retiree-c1e4@gregkh> References: <2026052808-zit-retiree-c1e4@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit commit f80d3d98d2ff78d9e2fe5d68b1f45948c4f7bd24 upstream. Without rtnl_lock held, a hardif might be retrieved as primary interface of a meshif, but then (while operating on this interface) getting decoupled from the mesh interface. In this case, the meshif still exists but the pointer from the primary hardif to the meshif is set to NULL. The mesh_iface must be checked first to be non-NULL before continuing to send an ARP request using meshif. Cc: stable@kernel.org Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code") Reported-by: Ido Schimmel Reported-by: syzbot+9fdcc9f05a98a540b816@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=9fdcc9f05a98a540b816 [ switch to old "mesh_iface" name "soft_iface" ] Signed-off-by: Sven Eckelmann --- net/batman-adv/bridge_loop_avoidance.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index 87f86c2bc4f22..15aeb07285e61 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c @@ -356,12 +356,14 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, const u8 *mac, sizeof(local_claim_dest)); local_claim_dest.type = claimtype; - soft_iface = primary_if->soft_iface; + soft_iface = READ_ONCE(primary_if->soft_iface); + if (!soft_iface) + goto out; skb = arp_create(ARPOP_REPLY, ETH_P_ARP, /* IP DST: 0.0.0.0 */ zeroip, - primary_if->soft_iface, + soft_iface, /* IP SRC: 0.0.0.0 */ zeroip, /* Ethernet DST: Broadcast */ -- 2.47.3