Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2343242ybz; Thu, 23 Apr 2020 16:23:43 -0700 (PDT) X-Google-Smtp-Source: APiQypI3yAuiNOR+FN9s79w8Efm+5JBSQXBxE6ZLTp7uGYWdrdmdSJUWQXGf26dkg56Ya3YQ69ib X-Received: by 2002:a05:6402:14c1:: with SMTP id f1mr4942956edx.221.1587684223487; Thu, 23 Apr 2020 16:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587684223; cv=none; d=google.com; s=arc-20160816; b=0sRd4/YWaxBTf1dR9PWnsiTxwdFiUg9584qBv3OVbZIPPVg9KJUAbv903z6gvwR9lP DcLrRngItowpciFTxOmK+/mbwRAc7D0qIOuAZlbYrppftrMrjgm/eB8U3jlNYKdjrcjo x4hdpwPkPF9RWaE2NbWHEOZRJWMTZVBvGxQfSMmt0us31/bINUOJJJDK5HZfpXfrQLHF tCK7BMzYqd11/nN0HKR6Azg4SaNzwcchLShq8rnGy2qks9nLGbpBZboX8edVKkexkX46 plM08wdVclyc0heNESCXKwqSpUeP+KmadBy89whGY34fVyk96QkufN1qfMe3XId0x3Zk YBfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=toiTehio5svTOQntqcCrYR25NRnpyxcjZrwWN1/D7Os=; b=GQw3hQ1Rrnl3s76bJv6fs/NNdCaqf0uKXG0FKFgFn01tKvCxo2gIRIdYUV2SRLMjeZ 85+2+ahYLlFWQ9Lu9wPtkT9MXyYKHkCAvubSFvg25rkjva3v/tfzpoEAfu+rdLBK1Mry NMhef662hg6mIqwfJ21jRnAmU4IvWW3BVbnwtz/fMapVndwxat7MungxK4mXEyRoxQCo jz1lKMa20p1w1mmdApekOyvClXzabR6KpRuUyU0WmJCdG+ppDSEW882WfNAqDxZmPzfz S4ey+LzvWlXDOqW6upzW2lkCpF9iQ1W64OPLU7Ub39Wu9QTLCoK6wcrEBDlHCEJptq6K fn9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a72si1942136edf.28.2020.04.23.16.23.19; Thu, 23 Apr 2020 16:23:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729472AbgDWXUK (ORCPT + 99 others); Thu, 23 Apr 2020 19:20:10 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:48730 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728231AbgDWXGe (ORCPT ); Thu, 23 Apr 2020 19:06:34 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRkvN-0004d7-LX; Fri, 24 Apr 2020 00:06:29 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvL-00E6kV-FP; Fri, 24 Apr 2020 00:06:27 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, Denis Kirjanov , "Eric Dumazet" , "David S. Miller" Date: Fri, 24 Apr 2020 00:05:03 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 076/245] neighbour: remove neigh_cleanup() method In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.83-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet commit f394722fb0d0f701119368959d7cd0ecbc46363a upstream. neigh_cleanup() has not been used for seven years, and was a wrong design. Messing with shared pointer in bond_neigh_init() without proper memory barriers would at least trigger syzbot complains eventually. It is time to remove this stuff. Fixes: b63b70d87741 ("IPoIB: Use a private hash table for path lookup in xmit path") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -3431,19 +3431,10 @@ static int bond_neigh_init(struct neighb return 0; parms.neigh_setup = NULL; - parms.neigh_cleanup = NULL; ret = slave_ops->ndo_neigh_setup(slave->dev, &parms); if (ret) return ret; - /* - * Assign slave's neigh_cleanup to neighbour in case cleanup is called - * after the last slave has been detached. Assumes that all slaves - * utilize the same neigh_cleanup (true at this writing as only user - * is ipoib). - */ - n->parms->neigh_cleanup = parms.neigh_cleanup; - if (!parms.neigh_setup) return 0; --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -71,7 +71,6 @@ struct neigh_parms { struct net_device *dev; struct neigh_parms *next; int (*neigh_setup)(struct neighbour *); - void (*neigh_cleanup)(struct neighbour *); struct neigh_table *tbl; void *sysctl_table; --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -103,9 +103,6 @@ static int neigh_blackhole(struct neighb static void neigh_cleanup_and_release(struct neighbour *neigh) { - if (neigh->parms->neigh_cleanup) - neigh->parms->neigh_cleanup(neigh); - __neigh_notify(neigh, RTM_DELNEIGH, 0); neigh_release(neigh); }