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 AD0A13451AA for ; Fri, 29 May 2026 18:20:45 +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=1780078846; cv=none; b=E5yt0qX/cfDEliPmgQGwqD6BOXLLN5CVW8kQEGybhPa0EkwfybNatf3K8fIhqoyELajAX6pypm/pSiQ/ZghYcP6uJQqJXtn4QvPFwDFgwlTZ77e0flxfa8Vo1sGlegeum0SB31nENS6uoAzFoTPhkG8q/lvliEvg1w0pZNkr0TI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780078846; c=relaxed/simple; bh=V5HP1lNAPc8CIzLAgLosVBMsoDCWtD0S1XKFJuZaXlk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BN5sTBYrun11got1SZ6ptFbUaTL3DNoITaAJoSaZbynCaGFymAh3yoSh+IXPKysv5ORgQsQkSs/KtSbqfwEphURBKFaOaZw2sGOMLSY1nh+ZKVnSZspvCnYE0RoZ/mffgyUVejNUbv9YNppnL+1S+dICe97XBNQo0tljUUTREoQ= 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=HPV6Yw3c; 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="HPV6Yw3c" Received: by dvalin.narfation.org (Postfix) id E50C32008A; Fri, 29 May 2026 18:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1780078844; 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=jKQVrnWJLtwUt2XM2A1J7elKeeop9NTVJ/ziwR6+evo=; b=HPV6Yw3cwTzPb6V7L+QndMtXkdMNDaXRcazmFBK3FdR7CG4buCOWFmD/NBTkwiLE8md3N1 l0A5greKwyWTM1VW8qYvQHJDzvM+ag7+xTVpPhc0iIffXeBS01gft/ciJbX0yeG0Q6QK/w Wv4jt3PX4mhAdBLJ0sRNNybFre1Ysn8= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann , stable@kernel.org, Ido Schimmel , syzbot+9fdcc9f05a98a540b816@syzkaller.appspotmail.com Subject: [PATCH 6.6.y] batman-adv: bla: avoid NULL-ptr deref for claim via dropped interface Date: Fri, 29 May 2026 20:20:23 +0200 Message-ID: <20260529182023.418742-1-sven@narfation.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <2026052809-dropkick-material-0b3e@gregkh> References: <2026052809-dropkick-material-0b3e@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 5f383a455f4dc..cfb1eb25c6ac4 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