From patchwork Sat Jun 1 22:27:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 10971507 Return-Path: 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 59A156C5 for ; Sat, 1 Jun 2019 22:28:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47C7B28CD4 for ; Sat, 1 Jun 2019 22:28:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33DAD28CE8; Sat, 1 Jun 2019 22:28:19 +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 7023828CD4 for ; Sat, 1 Jun 2019 22:28:18 +0000 (UTC) Received: (qmail 7687 invoked by uid 550); 1 Jun 2019 22:28:07 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 7560 invoked from network); 1 Jun 2019 22:28:05 -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=D3sdCrSta+1LinDxkJqXRJ9YdXWa10ctUItDBKvA25M=; b=gHAEz0W9Uu6qrM4ChuzLYGhD2n+4olfOU6qtJoOTBMe07a7Pc4Kg4feW7OCrB0FNOD pQJX/g4h2kdJiFQw/ZIM4s5GiPaQM2j5/cGGfHCrCR2g/GZ5h0YzW+8SpyH7GWKKIGYX JsyoEKMQELkCHYwUEweS6UvTXF7q7XQ+nsWJs= 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=D3sdCrSta+1LinDxkJqXRJ9YdXWa10ctUItDBKvA25M=; b=JzdqOmyMvVtxRLKsevXK9rZ6bb367bBMs99G12uPJAcN+ioUQ9h7gmnQ+U8xkor7KI 3PhPAQ7K5trDr9yDX6VWfQdW9OYCzRIqzQlaO8lvrz/WJ/StLVEXPo/eJl8/5NK6Xmia oMGmpr5UGQUusTRJnRgzNd5BKmJh7QqLzrwgJY1eh3RbMuI4ejSIeIz+QZIM3/bgMxxG 20Z5vmTiztbz7L/Nx3wBiAcR9qTnq3F5j88IjZvXDUvnhibquM7VVzNuL7l07xw1IAt1 bubjAcyvgJUiswW9UfcaAzzPgEDFL3M3MHIC8GHqciMoXXD4veGMRBzXinWbizlXwV5O HNwg== X-Gm-Message-State: APjAAAWn1klsZAo2nqZQcIOfEYRk59dn1YCRmjXh0PV0F8XtgwpUxjnY ecLwnkA6pf9CWfmB+JyX7rlf0w== X-Google-Smtp-Source: APXvYqyzFAgWiq9Zmv6qgFmEjp82uhykmH3iEDVhVPdvKHGIbsKdjW+zFeDMBpdGsYU3yEg7JY6LEQ== X-Received: by 2002:a62:a511:: with SMTP id v17mr19913167pfm.129.1559428073227; Sat, 01 Jun 2019 15:27:53 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Alexey Kuznetsov , Bjorn Helgaas , Borislav Petkov , "David S. Miller" , edumazet@google.com, Greg Kroah-Hartman , Hideaki YOSHIFUJI , "H. Peter Anvin" , Ingo Molnar , Josh Triplett , keescook@chromium.org, kernel-hardening@lists.openwall.com, Lai Jiangshan , Len Brown , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, Mathieu Desnoyers , neilb@suse.com, netdev@vger.kernel.org, oleg@redhat.com, "Paul E. McKenney" , Pavel Machek , peterz@infradead.org, "Rafael J. Wysocki" , rcu@vger.kernel.org, Steven Rostedt , Tejun Heo , Thomas Gleixner , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)) Subject: [RFC 2/6] ipv4: add lockdep condition to fix for_each_entry Date: Sat, 1 Jun 2019 18:27:34 -0400 Message-Id: <20190601222738.6856-3-joel@joelfernandes.org> X-Mailer: git-send-email 2.22.0.rc1.311.g5d7573a151-goog In-Reply-To: <20190601222738.6856-1-joel@joelfernandes.org> References: <20190601222738.6856-1-joel@joelfernandes.org> MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Joel Fernandes (Google) --- net/ipv4/fib_frontend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }