From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794585866; b=xNtdDW/qP7afHK2KG5lX1qnUQKPmdNgxjuaX4HXep7ESxzrn+yopM8NbKKCgGlfUnzlA YVIERK9YNU4sJnJAjSf1HNTmYIVixFXHNwFHGzAmiEZLTrk5Fgw8HfU2b2fjQCxRsZ+CY ZkPcWlvQfLKDkZ2lT9wsDSRi7SLrRLP9dUBm1APyIyYTfkl55ZYqC29+h9nUaAISXWUEO 1fRSBT7JJO66udU8aC/GZL1SBwhA2v3Vr7lh7Y5jfNl8a5YI6Xx9gLas2lsGqh84b/MP2 zVMkWKdR/8glRYUg5VcSAltFcSdbJZx+6CAgdO+e/OunRt6pq9BpmluWhwydYAWUcFQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794585866; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=4aZucxH1upUGZ38iaDfPLY+ONh3mzQ1THru2D9a9RXs=; b=W5l9Cj3HmC4nDhklgYKb6ZiFcaQZP4FnMhq0/pobJW1543oqrn1jt8Uh0K37MZFKSeEd AuZh2bTvWhZBvKhFJQ1wZGDcR1ASWvrkJ1uHKpqROrN3u5JNlOnBsH929SpWvEq9LMmHT SNZx+Z8apumZtEfh/QdhJUuOMFHBpO9zLNzeP5FOknOzCopFaaB8tnyxWuSAiRz0zGDGI uDe1Kq2f6MIPPOc7VvkMAY6Vqjy8bojvLLn+qcTjkCNEZpF3064PoeTFt3HhYBSfhZaW1 +6taFzoZYT6lMwY8XXp64tD4j0IGW/M4Zx4k+fiIemcfZ5oDbyyNkQgrqaOBvqbjbjQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=tDJqzc8t; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E4CC606EA80; Fri, 13 Nov 2026 16:04:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=tDJqzc8t Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A94A1F000C6; Fri, 13 Nov 2026 16:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1794585866; bh=4aZucxH1upUGZ38iaDfPLY+ONh3mzQ1THru2D9a9RXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tDJqzc8txGhU4yWcv1uIOFzKCbH3x1JlLQ0s46B4Hd/Ftafn1vrehAg9jDLdxafRM jpbYhDH0MrOJPdp/MxcIkAF9VQ4YhNzmvBJwiI6CLchiKlREHiiQzft+P+CJIIdpKl TEbibvh7oJjvM2m8ye+HaV1nlcj6D0D6hC8RbqOE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sven Eckelmann , Sasha Levin Subject: [PATCH 7.3 439/507] batman-adv: tt: only update flags for TT events Date: Fri, 13 Nov 2026 10:52:23 -0500 Message-ID: <20261113153811.615506485@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261113153753.358973689@linuxfoundation.org> References: <20261113153753.358973689@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sven Eckelmann commit ad1fd828aa3944efc393b84b0d7c02483f1b5638 upstream. In the first implementation of the translation table events, it was only possible to announce: * ADD: new locally detected client * DEL: disappeared local client If an ADD event was queued and then a DEL event was queued in the same timeslot, it is valid to destroy both events because nothing actually changed for remode nodes But with commit 3c4f7ab60cc2 ("batman-adv: improve the TT component to support runtime flag changes") and subsequent changes, it could also happen that there are extra ADD events: * ADD: _NEW_ locally detected client * ADD: already existing client with new flags * DEL: disappeared local client The first and the last type of event could in theory still be removed together from the (to be announced) events queue. But if the "update flags" ADD is dropped together with the DEL, it would still leave global translation table of a remote node in the incorrect state - believing that the client didn't disappear. If a detected client was previously announced, a DEL event must only overwrite the "update flags" ADD but the DEL itself must still continue to exist in the (to be anounced) events queue. For now, adjustment of the announced flags is used for everything instead of dropping already queued up events completely. Similarly, a DEL followed by an ADD caused both entries to be deleted. But the new ADD could announce flags changes which were not yet present for the client before it was marked for DELetion. The new ADD must therefore only overwrite the DEL - but still be kept. Cc: stable@vger.kernel.org Fixes: 3c4f7ab60cc2 ("batman-adv: improve the TT component to support runtime flag changes") [ Context ] Signed-off-by: Sven Eckelmann Signed-off-by: Sasha Levin --- net/batman-adv/translation-table.c | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 4ade3ca5af99c..ed8dcb8a66b13 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -418,6 +418,9 @@ batadv_tt_orig_list_entry_put(struct batadv_tt_orig_list_entry *orig_entry) * @bat_priv: the bat priv with all the mesh interface information * @tt_local_entry: the TT entry involved in the event * @event_flags: flags to store in the event structure + * + * Only a single change per client is queued. It describes the latest state of + * the client and a new event therefore replaces an already queued one. */ static void batadv_tt_local_event(struct batadv_priv *bat_priv, struct batadv_tt_local_entry *tt_local_entry, @@ -429,7 +432,6 @@ static void batadv_tt_local_event(struct batadv_priv *bat_priv, struct batadv_tt_change_node *entry; struct batadv_tt_change_node *safe; bool del_op_requested; - bool del_op_entry; size_t changes; tt_change_node = kmem_cache_alloc(batadv_tt_change_cache, GFP_ATOMIC); @@ -463,25 +465,12 @@ static void batadv_tt_local_event(struct batadv_priv *bat_priv, if (entry->change.vid != tt_change_node->change.vid) continue; - del_op_entry = entry->change.flags & BATADV_TT_CLIENT_DEL; - if (del_op_requested != del_op_entry) { - /* DEL+ADD in the same orig interval have no effect and - * can be removed to avoid silly behaviour on the - * receiver side. The other way around (ADD+DEL) can - * happen in case of roaming of a client still in the - * NEW state. Roaming of NEW clients is now possible due - * to automatically recognition of "temporary" clients - */ - list_del(&entry->list); - kmem_cache_free(batadv_tt_change_cache, entry); - changes--; - } else { - /* this is a second add or del in the same originator - * interval. It could mean that flags have been changed - * (e.g. double add): update them - */ - entry->change.flags = flags; - } + /* the other nodes may know the client with different + * flags. A DEL+ADD must therefore still announce the + * current flags and an ADD+DEL must still remove the + * client. ADD+ADD and DEL+DEL only update the flags + */ + entry->change.flags = flags; kmem_cache_free(batadv_tt_change_cache, tt_change_node); goto update_changes; -- 2.53.0