From patchwork Mon Jan 14 10:38:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Khlebnikov X-Patchwork-Id: 1024398 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=yandex-team.ru Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=yandex-team.ru header.i=@yandex-team.ru header.b="Vd0hZaf+"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43dVM35BVjz9sBQ for ; Mon, 14 Jan 2019 21:38:55 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbfANKiu (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 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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);