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 91EB0337B97 for ; Fri, 29 May 2026 20:16:25 +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=1780085786; cv=none; b=mGqUE83ljRCFzzYdqsPsNDhzudgHNpe2mXTgTU0Fw+ALv4sSZAFdz8y6LLG8uMXrdi7RVKUTzgl0NXaNGIIg8JLO5fLEHL2osu0i/0GBsF6RT+PBxK8AUBhC4gDrmaHMGBPVWQHWyU5iJDxPiHH5xS+D7rZAhR+Q4IZEeJY4uD8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780085786; c=relaxed/simple; bh=cX3Gp9YPWgbd5yI5osHEsQV1p/AmUHUMhBNCHB9LMZY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RSPqVm07fkNwNJCGHgYROJdpooNATXXnCJXRELyTbMLt0kxtcNZKSymVyrO0YbKDYQuYeKnlMLwOa+t8D5tSGEY91JVjLB9eMpkSrL5GkVpk7ppb0MSaZaMHaRUJr1J366/0+2/EYRPDUuKCeBL6/amqasq8FTBBmPu59zNLIcc= 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=0hfYyC9r; 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="0hfYyC9r" Received: by dvalin.narfation.org (Postfix) id BD3141FE5D; Fri, 29 May 2026 20:16:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1780085783; 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=gIOsSlhRjpVh0G29IkEdTJ3EDgeyER5QoYEzNf+I1mg=; b=0hfYyC9rwbmUQjT5U/1Dlpi1b2Bn/aIt2AY9JIFzWvWJNb28ab8GFBCA9eEyFJzNWqWj0u 0DOFuc6Qec7+19cEJV9gxOs5ruQI0wxXetXD2pVeUE4PYY6JnfcM18r1ifxyUye9+apwLl jBX6/VgNTTYOtzm65lWx9PckM+Jzjww= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann , stable@kernel.org, Ido Schimmel , syzbot+9fdcc9f05a98a540b816@syzkaller.appspotmail.com Subject: [PATCH 5.10.y] batman-adv: bla: avoid NULL-ptr deref for claim via dropped interface Date: Fri, 29 May 2026 22:16:21 +0200 Message-ID: <20260529201621.480949-1-sven@narfation.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <2026052811-seventeen-judge-8f33@gregkh> References: <2026052811-seventeen-judge-8f33@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 2923e3b28e6cc..8354e5473dc69 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c @@ -357,12 +357,14 @@ static void batadv_bla_send_claim(struct batadv_priv *bat_priv, 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