linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Thomas Falcon <tlfalcon@linux.ibm.com>,
	"David S . Miller" <davem@davemloft.net>,
	Sasha Levin <sashal@kernel.org>,
	linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 27/97] ibmvnic: Fix non-atomic memory allocation in IRQ context
Date: Wed, 26 Dec 2018 17:34:47 -0500	[thread overview]
Message-ID: <20181226223557.149329-27-sashal@kernel.org> (raw)
In-Reply-To: <20181226223557.149329-1-sashal@kernel.org>

From: Thomas Falcon <tlfalcon@linux.ibm.com>

[ Upstream commit 1d1bbc37f89b0559c9e913682f2489d89cfde6b8 ]

ibmvnic_reset allocated new reset work item objects in a non-atomic
context. This can be called from a tasklet, generating the output below.
Allocate work items with the GFP_ATOMIC flag instead.

BUG: sleeping function called from invalid context at mm/slab.h:421
in_atomic(): 1, irqs_disabled(): 1, pid: 93, name: kworker/0:2
INFO: lockdep is turned off.
irq event stamp: 66049
hardirqs last  enabled at (66048): [<c000000000122468>] tasklet_action_common.isra.12+0x78/0x1c0
hardirqs last disabled at (66049): [<c000000000befce8>] _raw_spin_lock_irqsave+0x48/0xf0
softirqs last  enabled at (66044): [<c000000000a8ac78>] dev_deactivate_queue.constprop.28+0xc8/0x160
softirqs last disabled at (66045): [<c0000000000306e0>] call_do_softirq+0x14/0x24
CPU: 0 PID: 93 Comm: kworker/0:2 Kdump: loaded Not tainted 4.20.0-rc6-00001-g1b50a8f03706 #7
Workqueue: events linkwatch_event
Call Trace:
[c0000003fffe7ae0] [c000000000bc83e4] dump_stack+0xe8/0x164 (unreliable)
[c0000003fffe7b30] [c00000000015ba0c] ___might_sleep+0x2dc/0x320
[c0000003fffe7bb0] [c000000000391514] kmem_cache_alloc_trace+0x3e4/0x440
[c0000003fffe7c30] [d000000005b2309c] ibmvnic_reset+0x16c/0x360 [ibmvnic]
[c0000003fffe7cc0] [d000000005b29834] ibmvnic_tasklet+0x1054/0x2010 [ibmvnic]
[c0000003fffe7e00] [c0000000001224c8] tasklet_action_common.isra.12+0xd8/0x1c0
[c0000003fffe7e60] [c000000000bf1238] __do_softirq+0x1a8/0x64c
[c0000003fffe7f90] [c0000000000306e0] call_do_softirq+0x14/0x24
[c0000003f3967980] [c00000000001ba50] do_softirq_own_stack+0x60/0xb0
[c0000003f39679c0] [c0000000001218a8] do_softirq+0xa8/0x100
[c0000003f39679f0] [c000000000121a74] __local_bh_enable_ip+0x174/0x180
[c0000003f3967a60] [c000000000bf003c] _raw_spin_unlock_bh+0x5c/0x80
[c0000003f3967a90] [c000000000a8ac78] dev_deactivate_queue.constprop.28+0xc8/0x160
[c0000003f3967ad0] [c000000000a8c8b0] dev_deactivate_many+0xd0/0x520
[c0000003f3967b70] [c000000000a8cd40] dev_deactivate+0x40/0x60
[c0000003f3967ba0] [c000000000a5e0c4] linkwatch_do_dev+0x74/0xd0
[c0000003f3967bd0] [c000000000a5e694] __linkwatch_run_queue+0x1a4/0x1f0
[c0000003f3967c30] [c000000000a5e728] linkwatch_event+0x48/0x60
[c0000003f3967c50] [c0000000001444e8] process_one_work+0x238/0x710
[c0000003f3967d20] [c000000000144a48] worker_thread+0x88/0x4e0
[c0000003f3967db0] [c00000000014e3a8] kthread+0x178/0x1c0
[c0000003f3967e20] [c00000000000bfd0] ret_from_kernel_thread+0x5c/0x6c

Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 5058bd83bdd6..c8704b1690eb 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -2055,7 +2055,7 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
 		}
 	}
 
-	rwi = kzalloc(sizeof(*rwi), GFP_KERNEL);
+	rwi = kzalloc(sizeof(*rwi), GFP_ATOMIC);
 	if (!rwi) {
 		spin_unlock_irqrestore(&adapter->rwi_lock, flags);
 		ibmvnic_close(netdev);
-- 
2.19.1


  parent reply	other threads:[~2018-12-26 22:53 UTC|newest]

Thread overview: 97+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-26 22:34 [PATCH AUTOSEL 4.19 01/97] ARM: dts: sun8i: a83t: bananapi-m3: increase vcc-pd voltage to 3.3V Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 02/97] pinctrl: meson: fix pull enable register calculation Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 03/97] arm64: dts: mt7622: fix no more console output on rfb1 Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 04/97] powerpc: Fix COFF zImage booting on old powermacs Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 05/97] powerpc/mm: Fix linux page tables build with some configs Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 06/97] HID: ite: Add USB id match for another ITE based keyboard rfkill key quirk Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 07/97] ARM: dts: imx7d-pico: Describe the Wifi clock Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 08/97] ARM: imx: update the cpu power up timing setting on i.mx6sx Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 09/97] ARM: dts: imx7d-nitrogen7: Fix the description of the Wifi clock Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 10/97] IB/mlx5: Block DEVX umem from the non applicable cases Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 11/97] Input: restore EV_ABS ABS_RESERVED Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 12/97] powerpc/mm: Fallback to RAM if the altmap is unusable Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 13/97] drm/amdgpu: Fix DEBUG_LOCKS_WARN_ON(depth <= 0) in amdgpu_ctx.lock Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 14/97] IB/core: Fix oops in netdev_next_upper_dev_rcu() Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 15/97] checkstack.pl: fix for aarch64 Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 16/97] xfrm: Fix error return code in xfrm_output_one() Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 17/97] xfrm: Fix bucket count reported to userspace Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 18/97] xfrm: Fix NULL pointer dereference in xfrm_input when skb_dst_force clears the dst_entry Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 19/97] ieee802154: hwsim: fix off-by-one in parse nested Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 20/97] netfilter: nf_tables: fix suspicious RCU usage in nft_chain_stats_replace() Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 21/97] netfilter: seqadj: re-load tcp header pointer after possible head reallocation Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 22/97] Revert "scsi: qla2xxx: Fix NVMe Target discovery" Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 23/97] scsi: bnx2fc: Fix NULL dereference in error handling Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 24/97] Input: omap-keypad - fix idle configuration to not block SoC idle states Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 25/97] Input: synaptics - enable RMI on ThinkPad T560 Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 26/97] ibmvnic: Convert reset work item mutex to spin lock Sasha Levin
2018-12-26 22:34 ` Sasha Levin [this message]
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 28/97] nfp: flower: ensure TCP flags can be placed in IPv6 frame Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 29/97] ieee802154: ca8210: fix possible u8 overflow in ca8210_rx_done Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 30/97] x86/mm: Fix guard hole handling Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 31/97] x86/dump_pagetables: Fix LDT remap address marker Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 32/97] i40e: fix mac filter delete when setting mac address Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 33/97] USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 34/97] ixgbe: Fix race when the VF driver does a reset Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 35/97] netfilter: ipset: do not call ipset_nest_end after nla_nest_cancel Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 36/97] netfilter: nat: can't use dst_hold on noref dst Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 37/97] netfilter: nf_conncount: use rb_link_node_rcu() instead of rb_link_node() Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 38/97] bnx2x: Clear fip MAC when fcoe offload support is disabled Sasha Levin
2018-12-26 22:34 ` [PATCH AUTOSEL 4.19 39/97] bnx2x: Remove configured vlans as part of unload sequence Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 40/97] bnx2x: Send update-svid ramrod with retry/poll flags enabled Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 41/97] scsi: target: iscsi: cxgbit: fix csk leak Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 42/97] scsi: target: iscsi: cxgbit: add missing spin_lock_init() Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 43/97] net/mlx5e: RX, Verify MPWQE stride size is in range Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 44/97] net/mlx5e: Cancel DIM work on close SQ Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 45/97] mt76: fix potential NULL pointer dereference in mt76_stop_tx_queues Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 46/97] x86, hyperv: remove PCI dependency Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 47/97] qed: Fix command number mismatch between driver and the mfw Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 48/97] drivers: net: xgene: Remove unnecessary forward declarations Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 49/97] net/tls: Init routines in create_ctx Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 50/97] w90p910_ether: remove incorrect __init annotation Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 51/97] qmi_wwan: Added support for Fibocom NL668 series Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 52/97] qmi_wwan: Added support for Telit LN940 series Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 53/97] net: clear skb->tstamp in forwarding paths Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 54/97] net: hns: Incorrect offset address used for some registers Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 55/97] net: hns: All ports can not work when insmod hns ko after rmmod Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 56/97] net: hns: Some registers use wrong address according to the datasheet Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 57/97] net: hns: Fixed bug that netdev was opened twice Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 58/97] net: hns: Clean rx fbd when ae stopped Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 59/97] net: hns: Free irq when exit from abnormal branch Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 60/97] net: hns: Avoid net reset caused by pause frames storm Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 61/97] net: hns: Fix ntuple-filters status error Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 62/97] net: hns: Add mac pcs config when enable|disable mac Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 63/97] net: hns: Fix ping failed when use net bridge and send multicast Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 64/97] net: mvneta: fix operation for 64K PAGE_SIZE Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 65/97] mac80211: fix a kernel panic when TXing after TXQ teardown Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 66/97] SUNRPC: Fix a race with XPRT_CONNECTING Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 67/97] mlxsw: core: Increase timeout during firmware flash process Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 68/97] net: mvpp2: 10G modes aren't supported on all ports Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 69/97] x86/mtrr: Don't copy uninitialized gentry fields back to userspace Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 70/97] qed: Fix an error code qed_ll2_start_xmit() Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 71/97] net: stmmac: Fix an error code in probe() Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 72/97] net: macb: restart tx after tx used bit read Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 73/97] net: macb: fix random memory corruption on RX with 64-bit DMA Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 74/97] net: macb: fix dropped RX frames due to a race Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 75/97] net: macb: add missing barriers when reading descriptors Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 76/97] lan743x: Expand phy search for LAN7431 Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 77/97] lan78xx: Resolve issue with changing MAC address Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 78/97] xen/netfront: tolerate frags with no data Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 79/97] vxge: ensure data0 is initialized in when fetching firmware version information Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 80/97] nl80211: fix memory leak if validate_pae_over_nl80211() fails Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 81/97] mac80211: free skb fraglist before freeing the skb Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 82/97] kbuild: fix false positive warning/error about missing libelf Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 83/97] m68k: Fix memblock-related crashes Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 84/97] net/mlx5e: RX, Fix wrong early return in receive queue poll Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 85/97] net/mlx5: Typo fix in del_sw_hw_rule Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 86/97] net/mlx5e: Remove the false indication of software timestamping support Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 87/97] virtio: fix test build after uio.h change Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 88/97] lan743x: Remove MAC Reset from initialization Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 89/97] net: mvpp2: fix the phylink mode validation Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 90/97] mscc: Configured MAC entries should be locked Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 91/97] gpio: mvebu: only fail on missing clk if pwm is actually to be used Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 92/97] Input: synaptics - enable SMBus for HP EliteBook 840 G4 Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 93/97] net: netxen: fix a missing check and an uninitialized use Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 94/97] qmi_wwan: Add support for Fibocom NL678 series Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 95/97] qmi_wwan: Fix qmap header retrieval in qmimux_rx_fixup Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 96/97] serial/sunsu: fix refcount leak Sasha Levin
2018-12-26 22:35 ` [PATCH AUTOSEL 4.19 97/97] auxdisplay: charlcd: fix x/y command parsing 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=20181226223557.149329-27-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tlfalcon@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).