From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.simonwunderlich.de (mail.simonwunderlich.de [23.88.38.48]) (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 E911746EF8F; Fri, 21 Aug 2026 09:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=23.88.38.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787306306; cv=none; b=H1o7dJNcAvM289KxGIozLAhXpUVTXkWDLp2eE/dCXb2n5Z3slW2mgh9sPSAs+ji6Sq2N1vJ4uNiEUTmsS6XY6Ta3ILnrAXpzPrTuzV4cBsKzervTDNy5c8qLPkkoT5aGjAjc7cHgHw4AxVKHzts8gVM4iSG2Qrs8wbwgTP6RpLA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787306306; c=relaxed/simple; bh=0zADE1y0LZTuLaptinBkWfCRiYO/BjMVxodW3k1OMjI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G5Ordo8OCsWQNhA/8r4kQImi2v1MzucXj3OCymeVIz7Tb53PgKPiOP2+uEdjo7q6U9s6aj08RwnWuho+mHwI8zXiqSmOE7IbkgBL4kJqL3g46nt/xwFnmzz70o9CgwIE9//lNjUkBNzQEaXV7eRhl/9WCM1u3GErW6zg/XM77Ns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=simonwunderlich.de; spf=pass smtp.mailfrom=simonwunderlich.de; dkim=pass (2048-bit key) header.d=simonwunderlich.de header.i=@simonwunderlich.de header.b=Tscumx/X; arc=none smtp.client-ip=23.88.38.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=simonwunderlich.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=simonwunderlich.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=simonwunderlich.de header.i=@simonwunderlich.de header.b="Tscumx/X" Received: from kero.packetmixer.de (p200300c59714fCD8ec8C87C354003FEd.dip0.t-ipconnect.de [IPv6:2003:c5:9714:fcd8:ec8c:87c3:5400:3fed]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.simonwunderlich.de (Postfix) with UTF8SMTPSA id B3699FA115; Fri, 21 Aug 2026 11:48:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=simonwunderlich.de; s=09092022; t=1787305699; 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=Aja7fiIJvKCXpa16GphaKqJjcsN9uuEdrCwqvq/BhVU=; b=Tscumx/X9rJ21lWlos1k9E+4eBQIgjsD/Unf6ilOTDyxyeRWfoTRux2MsgUBsqF0dkkC1y LADv0UvHX9ST1UgOkGzpoQ/y5lzSk1b8qJ7uiQZfEITE9KqiecIp7Qhk7h/f3wB0nt63f9 DFUw8UG3huG2ANQC6Ym09h0mocy1u8j50QbVWvEx/moX3he9rJUUDpSPIG17PbOlMtk4yO a0r7pfGv2V2sJC5A0RZT5lGtGQXlR5X7xNFh5S5Ym6LHJ5hYo2z+kCg6yZRD3hWSdzDZoZ S429QLtgFE2LKOmspZDzCTdn+McoG8SqNO+QKRNKcjHwBZAWa6iCGnd5EKqtvg== From: Simon Wunderlich To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , b.a.t.m.a.n@lists.open-mesh.org, Sven Eckelmann , stable@vger.kernel.org, Simon Wunderlich Subject: [PATCH net 3/9] batman-adv: bla: prevent CRC corruptions after claim flush Date: Fri, 21 Aug 2026 11:48:07 +0200 Message-ID: <20260821094813.201800-4-sw@simonwunderlich.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260821094813.201800-1-sw@simonwunderlich.de> References: <20260821094813.201800-1-sw@simonwunderlich.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Sven Eckelmann When batadv_bla_del_backbone_claims() tried to remove all claims of a backbone, it sets the CRC to 0. It assumes that the it had the last reference of the claims because batadv_claim_release() (which runs after the last reference was released), is XORing the crc16 of the claim address with the backbone CRC. If there would be a parallel holder of any of these references, it could happen that the backbone CRC is (0 ^ crc16(delayed_released_claim)). Which is the wrong starting point for the new claims it may receive when the remote answers the claim request from batadv_bla_send_request(). This reinitializations can be completely dropped to avoid this problem. batadv_claim_release() will take care of fixing the backbone CRC. Cc: stable@vger.kernel.org Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code") Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich --- net/batman-adv/bridge_loop_avoidance.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c index a3530cc90c959..3194ccdbce607 100644 --- a/net/batman-adv/bridge_loop_avoidance.c +++ b/net/batman-adv/bridge_loop_avoidance.c @@ -325,11 +325,6 @@ batadv_bla_del_backbone_claims(struct batadv_bla_backbone_gw *backbone_gw) } spin_unlock_bh(list_lock); } - - /* all claims gone, initialize CRC */ - spin_lock_bh(&backbone_gw->crc_lock); - backbone_gw->crc = BATADV_BLA_CRC_INIT; - spin_unlock_bh(&backbone_gw->crc_lock); } /** -- 2.47.3