From patchwork Tue Oct 30 21:01:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17599 Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id D5FE9830A3; Tue, 30 Oct 2018 22:01:42 +0100 (CET) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="Mf8r4Iqt"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id C741C8026B for ; Tue, 30 Oct 2018 22:01:40 +0100 (CET) Received: from sven-desktop.home.narfation.org (p200300C593D31FFD0000000000004065.dip0.t-ipconnect.de [IPv6:2003:c5:93d3:1ffd::4065]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 4451E110116; Tue, 30 Oct 2018 22:01:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1540933300; bh=qSEdaMIFsej7u5fOkxVbehbxhY7MUqpCXBS+om0cG64=; h=From:To:Cc:Subject:Date:From; b=Mf8r4Iqt0Vz06TutDC2FJ2BS6r788lI52rA2850ZitWQpAhY7vRe+rsEfrbs4/S7V g+h3H1HJQRLGvxKdQqruhG6K6HwOycdD31RNTVwIvob37sXKfNPUKjICx0jGllrDGl flo2N004iIB+SeFZz4hmIYk7KkXyPhbBk97Q+y24= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 30 Oct 2018 22:01:21 +0100 Message-Id: <20181030210130.18152-1-sven@narfation.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH 0/9] batman-adv: Add inconsistent nl dump detection X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The netlink dump functionality transfers a large number of entries from the kernel to userspace. It is rather likely that the transfer has to interrupted and later continued. During that time, it can happen that either new entries are added or removed. The userspace could than either receive some entries multiple times or miss entries. Commit 670dc2833d14 ("netlink: advertise incomplete dumps") introduced a mechanism to inform userspace about this problem. Userspace can then decide whether it is necessary or not to retry dumping the information again. The netlink dump functions have to be switched to exclusive locks to avoid changes while the current message is prepared. And an external generation sequence counter is introduced which tracks all modifications of the list/hash. There some netlink dump commands which were not yet modified. These datastructures use subentries (or entries for multiple main object) which makes mapping to a generation sequence counter more problematic: * originator * neighbor list (multiple interfaces make it harder) * global translation table Also the batadv_algo stuff was ignored because it doesn't even have locks and is not supposed to be modified at runtime. Kind regards, Sven Sven Eckelmann (9): batman-adv: Add compat for genl_dump_check_consistent batman-adv: Add inconsistent gateway netlink dump detection batman-adv: Add inconsistent hardif netlink dump detection batman-adv: Store modification counter via hash helpers batman-adv: Add inconsistent backbone netlink dump detection batman-adv: Add inconsistent claim netlink dump detection batman-adv: Add inconsistent dat netlink dump detection batman-adv: Add inconsistent local TT netlink dump detection batman-adv: Add inconsistent multicast netlink dump detection compat-include/net/genetlink.h | 45 ++++++++++++++ net/batman-adv/bat_iv_ogm.c | 24 +++++--- net/batman-adv/bat_v.c | 26 +++++--- net/batman-adv/bridge_loop_avoidance.c | 82 +++++++++++++++----------- net/batman-adv/distributed-arp-table.c | 42 +++++++------ net/batman-adv/gateway_client.c | 3 + net/batman-adv/hard-interface.c | 3 + net/batman-adv/hash.c | 2 + net/batman-adv/hash.h | 6 ++ net/batman-adv/main.c | 3 + net/batman-adv/main.h | 1 + net/batman-adv/multicast.c | 51 ++++++++-------- net/batman-adv/netlink.c | 24 ++++---- net/batman-adv/translation-table.c | 41 +++++++------ net/batman-adv/types.h | 5 +- 15 files changed, 233 insertions(+), 125 deletions(-) create mode 100644 compat-include/net/genetlink.h