mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Feras Daoud <ferasda@mellanox.com>,
	Erez Shitrit <erezsh@mellanox.com>,
	Leon Romanovsky <leon@kernel.org>,
	Doug Ledford <dledford@redhat.com>,
	"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Subject: [PATCH for 4.9 38/59] IB/ipoib: Replace list_del of the neigh->list with list_del_init
Date: Thu, 14 Sep 2017 15:51:16 +0000	[thread overview]
Message-ID: <20170914155051.8289-38-alexander.levin@verizon.com> (raw)
In-Reply-To: <20170914155051.8289-1-alexander.levin@verizon.com>

From: Feras Daoud <ferasda@mellanox.com>

[ Upstream commit c586071d1dc8227a7182179b8e50ee92cc43f6d2 ]

In order to resolve a situation where a few process delete
the same list element in sequence and cause panic, list_del
is replaced with list_del_init. In this case if the first
process that calls list_del releases the lock before acquiring
it again, other processes who can acquire the lock will call
list_del_init.

Fixes: b63b70d87741 ("IPoIB: Use a private hash table for path lookup")
Signed-off-by: Feras Daoud <ferasda@mellanox.com>
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Reviewed-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 08c4b0287304..183db0cd849e 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1302,7 +1302,7 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv)
 						   rcu_dereference_protected(neigh->hnext,
 									     lockdep_is_held(&priv->lock)));
 				/* remove from path/mc list */
-				list_del(&neigh->list);
+				list_del_init(&neigh->list);
 				call_rcu(&neigh->rcu, ipoib_neigh_reclaim);
 			} else {
 				np = &neigh->hnext;
@@ -1466,7 +1466,7 @@ void ipoib_neigh_free(struct ipoib_neigh *neigh)
 					   rcu_dereference_protected(neigh->hnext,
 								     lockdep_is_held(&priv->lock)));
 			/* remove from parent list */
-			list_del(&neigh->list);
+			list_del_init(&neigh->list);
 			call_rcu(&neigh->rcu, ipoib_neigh_reclaim);
 			return;
 		} else {
@@ -1551,7 +1551,7 @@ void ipoib_del_neighs_by_gid(struct net_device *dev, u8 *gid)
 						   rcu_dereference_protected(neigh->hnext,
 									     lockdep_is_held(&priv->lock)));
 				/* remove from parent list */
-				list_del(&neigh->list);
+				list_del_init(&neigh->list);
 				call_rcu(&neigh->rcu, ipoib_neigh_reclaim);
 			} else {
 				np = &neigh->hnext;
@@ -1593,7 +1593,7 @@ static void ipoib_flush_neighs(struct ipoib_dev_priv *priv)
 					   rcu_dereference_protected(neigh->hnext,
 								     lockdep_is_held(&priv->lock)));
 			/* remove from path/mc list */
-			list_del(&neigh->list);
+			list_del_init(&neigh->list);
 			call_rcu(&neigh->rcu, ipoib_neigh_reclaim);
 		}
 	}
-- 
2.11.0

  parent reply	other threads:[~2017-09-14 15:58 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14 15:51 [PATCH for 4.9 01/59] drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 02/59] drm: bridge: add DT bindings for TI ths8135 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 03/59] GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 05/59] ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 06/59] clk: sunxi-ng: fix PLL_CPUX adjusting on H3 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 04/59] drm/i915: Fix the overlay frontbuffer tracking Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 07/59] clk: sunxi-ng: set the parent rate when adjustin CPUX clock on A33 Levin, Alexander (Sasha Levin)
2017-09-15  2:02   ` icenowy
2017-09-15  2:08     ` Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 09/59] ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 11/59] MIPS: fix mem=X@Y commandline processing Levin, Alexander (Sasha Levin)
2017-09-14 18:59   ` Mathieu Malaterre
2017-09-14 19:11     ` Levin, Alexander (Sasha Levin)
2017-09-14 19:17       ` Mathieu Malaterre
2017-09-15  5:44         ` Marcin Nowakowski
2017-09-15 17:03           ` Paul Burton
2017-09-14 15:51 ` [PATCH for 4.9 10/59] MIPS: Ensure bss section ends on a long-aligned address Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 08/59] RDS: RDMA: Fix the composite message user notification Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 12/59] MIPS: kexec: Do not reserve invalid crashkernel memory on boot Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 14/59] MIPS: ralink: Fix incorrect assignment on ralink_soc Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 15/59] power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 13/59] MIPS: ralink: Fix a typo in the pinmux setup Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 16/59] scsi: be2iscsi: Add checks to validate CID alloc/free Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 17/59] ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 18/59] igb: re-assign hw address pointer on reset after PCI error Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 20/59] reset: ti_syscon: fix a ti_syscon_reset_status issue Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 21/59] sh_eth: use correct name for ECMR_MPDE bit Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 19/59] extcon: axp288: Use vbus-valid instead of -present to determine cable presence Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 23/59] clk: wm831x: fix usleep_range with bad range Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 24/59] usb: make the MTK XHCI driver compile for older MIPS SoCs Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 25/59] hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 22/59] clk/axs10x: Clear init field in driver probe Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 28/59] iio: adc: hx711: Add DT binding for avia,hx711 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 27/59] iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 29/59] IB/rxe: Add a runtime check in alloc_index() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 26/59] iio: adc: imx25-gcq: Fix module autoload Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 33/59] serial: 8250: moxa: Store num_ports in brd Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 32/59] drm/i915/psr: disable psr2 for resolution greater than 32X20 Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 30/59] IB/rxe: Fix a MR reference leak in check_rkey() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 31/59] ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 36/59] IB/ipoib: Fix deadlock over vlan_mutex Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 37/59] IB/ipoib: rtnl_unlock can not come after free_netdev Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 34/59] tty: goldfish: Fix a parameter of a call to free_irq Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 35/59] serial: 8250_port: Remove dangerous pr_debug() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` Levin, Alexander (Sasha Levin) [this message]
2017-09-14 15:51 ` [PATCH for 4.9 39/59] arm: dts: mt2701: Add subsystem clock controller device nodes Levin, Alexander (Sasha Levin)
2017-09-15 11:15   ` Matthias Brugger
2017-09-17 23:20     ` Levin, Alexander (Sasha Levin)
2017-09-18 10:28       ` Matthias Brugger
2017-09-14 15:51 ` [PATCH for 4.9 41/59] USB: serial: mos7720: fix control-message error handling Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 40/59] drm/amdkfd: fix improper return value on error Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 43/59] sfc: get PIO buffer size from the NIC Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 45/59] partitions/efi: Fix integer overflow in GPT size calculation Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 44/59] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show() Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 42/59] USB: serial: mos7840: fix control-message error handling Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 47/59] audit: log 32-bit socketcalls Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 49/59] spi: pxa2xx: Add support for Intel Gemini Lake Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 48/59] ath10k: prevent sta pointer rcu violation Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 46/59] ASoC: dapm: handle probe deferrals Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 51/59] usb: chipidea: vbus event may exist before starting gadget Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 52/59] rtl8xxxu: Add additional USB IDs for rtl8192eu devices Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 50/59] iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged' Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 53/59] ASoC: dapm: fix some pointer error handling Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 57/59] MIPS: Lantiq: Fix another request_mem_region() return code check Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 56/59] HID: wacom: release the resources before leaving despite devm Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 55/59] drm: mali-dp: Fix transposed horizontal/vertical flip Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 54/59] drm: mali-dp: Fix destination size handling when rotating Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 58/59] mips: ath79: clock:- Unmap region obtained by of_iomap Levin, Alexander (Sasha Levin)
2017-09-14 15:51 ` [PATCH for 4.9 59/59] lkdtm: Fix Oops when unloading the module Levin, Alexander (Sasha Levin)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170914155051.8289-38-alexander.levin@verizon.com \
    --to=alexander.levin@verizon.com \
    --cc=dledford@redhat.com \
    --cc=erezsh@mellanox.com \
    --cc=ferasda@mellanox.com \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®