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 A809D4F55A5; Wed, 9 Sep 2026 13:56:35 +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=1788962196; cv=none; b=mgSsVef52bCAm7+hF4Dsls8/5+uucs4UX/6SBS5FWs8WqUKhZ+71/hCSyykyI2b7mfIUenC4GdAjL+wm6Y0JhyCyHFYjaPAXZvjH1QJy6f92IhS1qErtCXxA+Ehzje1u5dtDmnQJ+7gwZ1uZyZ+ISsZQ7BmLF5QiFLXgoONm5P0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788962196; c=relaxed/simple; bh=jjxf/9sB/C5On4d91VzpySd9oTJyePxZbzAyPdLentg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UHPYPeMhceNPtd+dTSYDbjGG0b9vhCF+eMKdDO/Wa3SDFVyPtCC8NJ7tDDw0LSAJEuIVzp8pEHIzkTPniXc/637gX/vFPWzcpAcmN4q4XAH+JLIPSclAvSLgZYWXCcFLlTcUzJ3dQKZo/Cel1ACY10YqMUyV+ed7Z3WyI/KDK2w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fZCe4VOW; 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="fZCe4VOW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 071DD1F00A3A; Wed, 9 Sep 2026 13:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1788962195; bh=ZmNmqiWPt4vKCjuG2MMYMewUi7WTzLpQ9IOaYn9UQkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fZCe4VOWyjx+SWUWHb0Yeu/wxt4LUcFu6TUUzEvBFWaFVTBG1Tj/3Eb4XWRJxHN6w DAwgrKcFUIbHoIYT4LkIEjJmRRLn1UW+S8Mbu+6SBqVmRv9Q7gKI7zqU4GCAdxmgLa R+lGV2KvyBcpNklNsRx7imjzvl2synIOgbdVHAgY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Sven Eckelmann Subject: [PATCH 7.2 205/556] batman-adv: bla: fix freeing of claims on meshif deletion Date: Wed, 9 Sep 2026 15:38:05 +0200 Message-ID: <20260909134237.602553246@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260909134230.441546314@linuxfoundation.org> References: <20260909134230.441546314@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 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sven Eckelmann commit 8d128c932bced74e3b1625ba3d7c78ef122a88a7 upstream. When the mesh interface is getting deleted, then batadv_bla_del_backbone_claims() (via batadv_bla_purge_backbone_gw()) could make sure that all claims gets removed. But this function is only executed when bat_priv->bla.claim_hash is not NULL. And since batadv_bla_free() is always setting it to NULL before it is (indirectly) called, it was never actually executed. But the batadv_bla_purge_claims() -> batadv_handle_unclaim() is at the moment too fragile because the BLA code is not handling the rehashing in batadv_bla_update_orig_address(). The stored backbone address doesn't have to be the one actually used for the hash bucket selection during the initial adding of the backbone. The batadv_handle_unclaim() can therefore fail to find the respective backbone for the unclaim and then stop the deletion. But the actual backbone_gw object is not needed for the unclaim because all relevant information is always provided by the caller. And the check for the existence of the backbone_gw doesn't provide any additional security check for the deletion of a claim. Cc: stable@kernel.org Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code") Signed-off-by: Sven Eckelmann Signed-off-by: Greg Kroah-Hartman --- net/batman-adv/bridge_loop_avoidance.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c @@ -942,26 +942,18 @@ static bool batadv_handle_unclaim(struct const u8 *backbone_addr, const u8 *claim_addr, unsigned short vid) { - struct batadv_bla_backbone_gw *backbone_gw; - /* unclaim in any case if it is our own */ if (primary_if && batadv_compare_eth(backbone_addr, primary_if->net_dev->dev_addr)) batadv_bla_send_claim(bat_priv, claim_addr, vid, BATADV_CLAIM_TYPE_UNCLAIM); - backbone_gw = batadv_backbone_hash_find(bat_priv, backbone_addr, vid); - - if (!backbone_gw) - return true; - /* this must be an UNCLAIM frame */ batadv_dbg(BATADV_DBG_BLA, bat_priv, "%s(): UNCLAIM %pM on vid %d (sent by %pM)...\n", __func__, - claim_addr, batadv_print_vid(vid), backbone_gw->orig); + claim_addr, batadv_print_vid(vid), backbone_addr); batadv_bla_del_claim(bat_priv, claim_addr, vid); - batadv_backbone_gw_put(backbone_gw); return true; }