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 807663AFD1D for ; Fri, 29 May 2026 20:08:53 +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=1780085334; cv=none; b=tG0zMGUznSgZ9qcbeaH/hb1QtI1TQ1roaQkcPIvqJH3CMYZf7fdN5Hpo3UUdCUvNvZr6iUkEKSpYC93nonDSzuHV7bllt2tJW4f9sVPbMAxH2MmSVkA4oIcbvNaMyNZa9HrL3LzuYJM+KZhLcVN2E1sGuqaIEE5XCkj2Gl7Lorw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780085334; c=relaxed/simple; bh=DZonokUqCPvj/SL98v10ZuE6uf3/GxukA09Wg8l4E9Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ULOsiUOwK09RlQDIR6VbdShPf/b1pOiotuZuJiA/3AdwbpS9+4DsIboEh30lQxjBcwK5W12kdx+hIXgESf0xcn0/P5Jkn8M8MTl+M+tWt+LSmUvbJmxdZeVeCM9DtuoEdDTsmplglo9k+bZCHLYplW03a9o8CnoHEj8ZsQpvbkk= 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=aegtWJug; 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="aegtWJug" Received: by dvalin.narfation.org (Postfix) id C960B2000E; Fri, 29 May 2026 20:08:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1780085331; 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=TBHzAaeliqS3+zcBCwqrkf7nXeFqPHvHVfaETEtjzIA=; b=aegtWJugP1mFJ/vs8Gg57mZIdP7/GFi4k2AfnBeqlY1rdBQ+3hBneZDodv4rg+fdmXcnEV wMkn1/p66VQxj3PGnqpOgg47ZIkCuSG0+qKp4E351PAuPSzkRPb1zqFQnRrNgU4+zGusSK gd2uYUIZEj+vd3bwym0545pPUWhKX9Y= From: Sven Eckelmann To: stable@vger.kernel.org Cc: Sven Eckelmann , stable@kernel.org, Ido Schimmel , syzbot+9fdcc9f05a98a540b816@syzkaller.appspotmail.com Subject: [PATCH 5.15.y] batman-adv: bla: avoid NULL-ptr deref for claim via dropped interface Date: Fri, 29 May 2026 22:08:49 +0200 Message-ID: <20260529200849.478452-1-sven@narfation.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <2026052810-stony-vegan-6fc0@gregkh> References: <2026052810-stony-vegan-6fc0@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 92c9679f38437..452e78fd70c03 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c @@ -355,12 +355,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