Message ID | 20190712170024.111093-5-joel@joelfernandes.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <kernel-hardening-return-16433-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF726138D for <patchwork-kernel-hardening@patchwork.kernel.org>; Fri, 12 Jul 2019 17:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA7FF28409 for <patchwork-kernel-hardening@patchwork.kernel.org>; Fri, 12 Jul 2019 17:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADE4F28C5B; Fri, 12 Jul 2019 17:01:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id E95E228409 for <patchwork-kernel-hardening@patchwork.kernel.org>; Fri, 12 Jul 2019 17:01:26 +0000 (UTC) Received: (qmail 1462 invoked by uid 550); 12 Jul 2019 17:01:03 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: <mailto:kernel-hardening@lists.openwall.com> List-Help: <mailto:kernel-hardening-help@lists.openwall.com> List-Unsubscribe: <mailto:kernel-hardening-unsubscribe@lists.openwall.com> List-Subscribe: <mailto:kernel-hardening-subscribe@lists.openwall.com> List-ID: <kernel-hardening.lists.openwall.com> Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 1361 invoked from network); 12 Jul 2019 17:01:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T5MSBvyW+UnMIf1PMXwWQpclTkJPOBVtLcNCxIfokXY=; b=W4pcI9yzebCS/ajeXGrdH4WDZbUsJndTMc7qtATG156f3ffkoMMnM+27/wia2nKDJk 8+5mV67a7LLoP3HBFS64qyErr1wWta5bAaSdftnGrTPpiVb4PMfGdj4gRSASKJrtE/bk y6MZeHXSPOQSGLoKr4GkENL9AUyzztzIy9lqM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T5MSBvyW+UnMIf1PMXwWQpclTkJPOBVtLcNCxIfokXY=; b=DeLPVksNXbEbDBuspdYMZO2ZOMwY5grg63YxaHPGi0XqLF6NIr5SehiPb0VqvXRa+h jpD2x+FgHaneY5Lcc9YzlroQWiz0J3ghX9h3GWdPLUf06nt4lETF+bkby99wNq7hOprE FY8TtmmO9tDK124Z61oIw7GkVz5T/St0+BxtDfogtQeI1yWgJFb5NdmbkvYvJdrA8p+2 ySjAx7vMZxo10hJVLqamENAYsNviaBNKvUDkv95TnDgqOVtDoLxb+KvfkIVpN0BFT5jH Fqv2FspautbVZkbEn2K3JH/A0nAFv1lpCHmxrcjw9cZN8NY74g/mujuqfZZoPDWX1zVf kpjg== X-Gm-Message-State: APjAAAVJKHh8OKHfuw8hs6u5+eagfS+SWWaXlslOgx/saxZe1RdE6ihT UDIRAYgefFFEjoFkurGC15E= X-Google-Smtp-Source: APXvYqzuhVtiWBYlZH/aw0dkC1YS/lLyobD9k2bBGXEKSZ5NHGo/6vz/hQ+QEQLkxRGkEG+1756i7A== X-Received: by 2002:a65:4489:: with SMTP id l9mr12246140pgq.207.1562950850333; Fri, 12 Jul 2019 10:00:50 -0700 (PDT) From: "Joel Fernandes (Google)" <joel@joelfernandes.org> To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" <joel@joelfernandes.org>, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>, Bjorn Helgaas <bhelgaas@google.com>, Borislav Petkov <bp@alien8.de>, c0d1n61at3@gmail.com, "David S. Miller" <davem@davemloft.net>, edumazet@google.com, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>, "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>, Jonathan Corbet <corbet@lwn.net>, Josh Triplett <josh@joshtriplett.org>, keescook@chromium.org, kernel-hardening@lists.openwall.com, kernel-team@android.com, Lai Jiangshan <jiangshanlai@gmail.com>, Len Brown <lenb@kernel.org>, linux-acpi@vger.kernel.org, linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, neilb@suse.com, netdev@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>, "Paul E. McKenney" <paulmck@linux.ibm.com>, Pavel Machek <pavel@ucw.cz>, peterz@infradead.org, "Rafael J. Wysocki" <rjw@rjwysocki.net>, Rasmus Villemoes <rasmus.villemoes@prevas.dk>, rcu@vger.kernel.org, Steven Rostedt <rostedt@goodmis.org>, Tejun Heo <tj@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, will@kernel.org, x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Subject: [PATCH v2 4/9] ipv4: add lockdep condition to fix for_each_entry Date: Fri, 12 Jul 2019 13:00:19 -0400 Message-Id: <20190712170024.111093-5-joel@joelfernandes.org> X-Mailer: git-send-email 2.22.0.510.g264f2c817a-goog In-Reply-To: <20190712170024.111093-1-joel@joelfernandes.org> References: <20190712170024.111093-1-joel@joelfernandes.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Harden list_for_each_entry_rcu() and family
|
expand
|
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index b298255f6fdb..ef7c9f8e8682 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -127,7 +127,8 @@ struct fib_table *fib_get_table(struct net *net, u32 id) h = id & (FIB_TABLE_HASHSZ - 1); head = &net->ipv4.fib_table_hash[h]; - hlist_for_each_entry_rcu(tb, head, tb_hlist) { + hlist_for_each_entry_rcu(tb, head, tb_hlist, + lockdep_rtnl_is_held()) { if (tb->tb_id == id) return tb; }
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org> --- net/ipv4/fib_frontend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)