From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C52DC43387 for ; Mon, 14 Jan 2019 10:38:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C675720656 for ; Mon, 14 Jan 2019 10:38:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=yandex-team.ru header.i=@yandex-team.ru header.b="Vd0hZaf+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726598AbfANKiu (ORCPT ); Mon, 14 Jan 2019 05:38:50 -0500 Received: from forwardcorp1j.cmail.yandex.net ([5.255.227.105]:39354 "EHLO forwardcorp1j.cmail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725837AbfANKit (ORCPT ); Mon, 14 Jan 2019 05:38:49 -0500 Received: from mxbackcorp2j.mail.yandex.net (mxbackcorp2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::119]) by forwardcorp1j.cmail.yandex.net (Yandex) with ESMTP id A99D22025B; Mon, 14 Jan 2019 13:38:46 +0300 (MSK) Received: from smtpcorp1j.mail.yandex.net (smtpcorp1j.mail.yandex.net [2a02:6b8:0:1619::137]) by mxbackcorp2j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id kWYqzNfIgA-ckJi8bVY; Mon, 14 Jan 2019 13:38:46 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1547462326; bh=IbTxmx0Pu5CMvH65woOVWKB1adaR0WOjfKk8NlGN6Aw=; h=Subject:From:To:Cc:Date:Message-ID; b=Vd0hZaf+UauTrLgurJLbAhZoGUzvb0NU3T2c/9P/5IKyZtCrhQV/4Ms1K7fbMZtnl oIQFUyumSsWQJM7qOwxYNDcT0ACfI3SepPAPi942m4WOWZ0h4tEaCSRIaf5kCgca+Y UkEXv/9Znd/NMEjhnsqzFzExiHIer/IL2ahRMzOE= Authentication-Results: mxbackcorp2j.mail.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-red.dhcp.yndx.net (dynamic-red.dhcp.yndx.net [2a02:6b8:0:40c:ddac:7ad6:150c:c9b3]) by smtpcorp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id DQeHvy6JIl-ckhWpDGD; Mon, 14 Jan 2019 13:38:46 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) Subject: [PATCH] net/core/neighbour: fix kmemleak minimal reference count for hash tables From: Konstantin Khlebnikov To: netdev@vger.kernel.org, "David S. Miller" Cc: Cong Wang , LKML , Catalin Marinas Date: Mon, 14 Jan 2019 13:38:43 +0300 Message-ID: <154746232378.234732.3976012997312897852.stgit@buzz> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This should be 1 for normal allocations, 0 disables leak reporting. Signed-off-by: Konstantin Khlebnikov Reported-by: Cong Wang Fixes: 85704cb8dcfd ("net/core/neighbour: tell kmemleak about hash tables") --- net/core/neighbour.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 3e27a779f288..96fdc9134726 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -450,7 +450,7 @@ static struct neigh_hash_table *neigh_hash_alloc(unsigned int shift) buckets = (struct neighbour __rcu **) __get_free_pages(GFP_ATOMIC | __GFP_ZERO, get_order(size)); - kmemleak_alloc(buckets, size, 0, GFP_ATOMIC); + kmemleak_alloc(buckets, size, 1, GFP_ATOMIC); } if (!buckets) { kfree(ret);