linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, James Smart <jsmart2021@gmail.com>,
	"Ewan D. Milne" <emilne@redhat.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: [PATCH 5.10 12/96] scsi: lpfc: Move initialization of phba->poll_list earlier to avoid crash
Date: Mon, 16 Aug 2021 15:01:22 +0200	[thread overview]
Message-ID: <20210816125435.333947697@linuxfoundation.org> (raw)
In-Reply-To: <20210816125434.948010115@linuxfoundation.org>

From: Ewan D. Milne <emilne@redhat.com>

commit 9977d880f7a3c233db9165a75a3a14defc2a4aee upstream.

The phba->poll_list is traversed in case of an error in
lpfc_sli4_hba_setup(), so it must be initialized earlier in case the error
path is taken.

[  490.030738] lpfc 0000:65:00.0: 0:1413 Failed to init iocb list.
[  490.036661] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
[  490.044485] PGD 0 P4D 0
[  490.047027] Oops: 0000 [#1] SMP PTI
[  490.050518] CPU: 0 PID: 7 Comm: kworker/0:1 Kdump: loaded Tainted: G          I      --------- -  - 4.18.
[  490.060511] Hardware name: Dell Inc. PowerEdge R440/0WKGTH, BIOS 1.4.8 05/22/2018
[  490.067994] Workqueue: events work_for_cpu_fn
[  490.072371] RIP: 0010:lpfc_sli4_cleanup_poll_list+0x20/0xb0 [lpfc]
[  490.078546] Code: cf e9 04 f7 fe ff 0f 1f 40 00 0f 1f 44 00 00 41 57 49 89 ff 41 56 41 55 41 54 4d 8d a79
[  490.097291] RSP: 0018:ffffbd1a463dbcc8 EFLAGS: 00010246
[  490.102518] RAX: 0000000000008200 RBX: ffff945cdb8c0000 RCX: 0000000000000000
[  490.109649] RDX: 0000000000018200 RSI: ffff9468d0e16818 RDI: 0000000000000000
[  490.116783] RBP: ffff945cdb8c1740 R08: 00000000000015c5 R09: 0000000000000042
[  490.123915] R10: 0000000000000000 R11: ffffbd1a463dbab0 R12: ffff945cdb8c25c0
[  490.131049] R13: 00000000fffffff4 R14: 0000000000001800 R15: ffff945cdb8c0000
[  490.138182] FS:  0000000000000000(0000) GS:ffff9468d0e00000(0000) knlGS:0000000000000000
[  490.146267] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  490.152013] CR2: 0000000000000000 CR3: 000000042ca10002 CR4: 00000000007706f0
[  490.159146] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  490.166277] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[  490.173409] PKRU: 55555554
[  490.176123] Call Trace:
[  490.178598]  lpfc_sli4_queue_destroy+0x7f/0x3c0 [lpfc]
[  490.183745]  lpfc_sli4_hba_setup+0x1bc7/0x23e0 [lpfc]
[  490.188797]  ? kernfs_activate+0x63/0x80
[  490.192721]  ? kernfs_add_one+0xe7/0x130
[  490.196647]  ? __kernfs_create_file+0x80/0xb0
[  490.201020]  ? lpfc_pci_probe_one_s4.isra.48+0x46f/0x9e0 [lpfc]
[  490.206944]  lpfc_pci_probe_one_s4.isra.48+0x46f/0x9e0 [lpfc]
[  490.212697]  lpfc_pci_probe_one+0x179/0xb70 [lpfc]
[  490.217492]  local_pci_probe+0x41/0x90
[  490.221246]  work_for_cpu_fn+0x16/0x20
[  490.224994]  process_one_work+0x1a7/0x360
[  490.229009]  ? create_worker+0x1a0/0x1a0
[  490.232933]  worker_thread+0x1cf/0x390
[  490.236687]  ? create_worker+0x1a0/0x1a0
[  490.240612]  kthread+0x116/0x130
[  490.243846]  ? kthread_flush_work_fn+0x10/0x10
[  490.248293]  ret_from_fork+0x35/0x40
[  490.251869] Modules linked in: lpfc(+) xt_CHECKSUM ipt_MASQUERADE xt_conntrack ipt_REJECT nf_reject_ipv4i
[  490.332609] CR2: 0000000000000000

Link: https://lore.kernel.org/r/20210809150947.18104-1-emilne@redhat.com
Fixes: 93a4d6f40198 ("scsi: lpfc: Add registration for CPU Offline/Online events")
Cc: stable@vger.kernel.org
Reviewed-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Ewan D. Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/scsi/lpfc/lpfc_init.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -13080,6 +13080,8 @@ lpfc_pci_probe_one_s4(struct pci_dev *pd
 	if (!phba)
 		return -ENOMEM;
 
+	INIT_LIST_HEAD(&phba->poll_list);
+
 	/* Perform generic PCI device enabling operation */
 	error = lpfc_enable_pci_dev(phba);
 	if (error)
@@ -13214,7 +13216,6 @@ lpfc_pci_probe_one_s4(struct pci_dev *pd
 	/* Enable RAS FW log support */
 	lpfc_sli4_ras_setup(phba);
 
-	INIT_LIST_HEAD(&phba->poll_list);
 	timer_setup(&phba->cpuhp_poll_timer, lpfc_sli4_poll_hbtimer, 0);
 	cpuhp_state_add_instance_nocalls(lpfc_cpuhp_state, &phba->cpuhp);
 



  parent reply	other threads:[~2021-08-16 13:09 UTC|newest]

Thread overview: 112+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 13:01 [PATCH 5.10 00/96] 5.10.60-rc1 review Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 01/96] iio: adc: ti-ads7950: Ensure CS is deasserted after reading channels Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 02/96] iio: adis: set GPIO reset pin direction Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 03/96] iio: humidity: hdc100x: Add margin to the conversion time Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 04/96] iio: adc: Fix incorrect exit of for-loop Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 05/96] ASoC: amd: Fix reference to PCM buffer address Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 06/96] ASoC: xilinx: " Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 07/96] ASoC: uniphier: " Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 08/96] ASoC: tlv320aic31xx: Fix jack detection after suspend Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 09/96] ASoC: intel: atom: Fix reference to PCM buffer address Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 10/96] i2c: dev: zero out array used for i2c reads from userspace Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 11/96] cifs: create sd context must be a multiple of 8 Greg Kroah-Hartman
2021-08-16 13:01 ` Greg Kroah-Hartman [this message]
2021-08-16 13:01 ` [PATCH 5.10 13/96] seccomp: Fix setting loaded filter count during TSYNC Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 14/96] net: ethernet: ti: cpsw: fix min eth packet size for non-switch use-cases Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 15/96] ARC: fp: set FPU_STATUS.FWE to enable FPU_STATUS update on context switch Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 16/96] ceph: reduce contention in ceph_check_delayed_caps() Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 17/96] ACPI: NFIT: Fix support for virtual SPA ranges Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 18/96] libnvdimm/region: Fix label activation vs errors Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 19/96] drm/amd/display: Remove invalid assert for ODM + MPC case Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 20/96] drm/amd/display: use GFP_ATOMIC in amdgpu_dm_irq_schedule_work Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 21/96] drm/amdgpu: dont enable baco on boco platforms in runpm Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 22/96] ieee802154: hwsim: fix GPF in hwsim_set_edge_lqi Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 23/96] ieee802154: hwsim: fix GPF in hwsim_new_edge_nl Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 24/96] pinctrl: mediatek: Fix fallback behavior for bias_set_combo Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 25/96] ASoC: cs42l42: Correct definition of ADC Volume control Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 26/96] ASoC: cs42l42: Dont allow SND_SOC_DAIFMT_LEFT_J Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 27/96] interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 28/96] ASoC: SOF: Intel: hda-ipc: fix reply size checking Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 29/96] ASoC: cs42l42: Fix inversion of ADC Notch Switch control Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 30/96] ASoC: cs42l42: Remove duplicate control for WNF filter frequency Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 31/96] netfilter: nf_conntrack_bridge: Fix memory leak when error Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 32/96] pinctrl: tigerlake: Fix GPIO mapping for newer version of software Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 33/96] ASoC: cs42l42: Fix LRCLK frame start edge Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 34/96] net: dsa: mt7530: add the missing RxUnicast MIB counter Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 35/96] net: mvvp2: fix short frame size on s390 Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 36/96] platform/x86: pcengines-apuv2: Add missing terminating entries to gpio-lookup tables Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 37/96] libbpf: Fix probe for BPF_PROG_TYPE_CGROUP_SOCKOPT Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 38/96] bpf: Fix integer overflow involving bucket_size Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 39/96] net: phy: micrel: Fix link detection on ksz87xx switch" Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 40/96] ppp: Fix generating ifname when empty IFLA_IFNAME is specified Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 41/96] net/smc: fix wait on already cleared link Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 42/96] net: sched: act_mirred: Reset ct info when mirror/redirect skb Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 43/96] ice: Prevent probing virtual functions Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 44/96] ice: dont remove netdev->dev_addr from uc sync list Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 45/96] iavf: Set RSS LUT and key in reset handle path Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 46/96] psample: Add a fwd declaration for skbuff Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 47/96] bareudp: Fix invalid read beyond skbs linear data Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 48/96] net/mlx5: Synchronize correct IRQ when destroying CQ Greg Kroah-Hartman
2021-08-16 13:01 ` [PATCH 5.10 49/96] net/mlx5: Fix return value from tracer initialization Greg Kroah-Hartman
2021-08-17 17:51   ` Pavel Machek
2021-08-18  7:44     ` Saeed Mahameed
2021-08-18 19:28       ` Pavel Machek
2021-08-16 13:02 ` [PATCH 5.10 50/96] drm/meson: fix colour distortion from HDR set during vendor u-boot Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 51/96] net: dsa: microchip: Fix ksz_read64() Greg Kroah-Hartman
2021-08-17 17:56   ` Pavel Machek
2021-08-17 18:20     ` Ben Hutchings
2021-08-18 19:26       ` Pavel Machek
2021-08-16 13:02 ` [PATCH 5.10 52/96] net: dsa: microchip: ksz8795: Fix VLAN filtering Greg Kroah-Hartman
2021-08-16 13:28   ` Ben Hutchings
2021-08-16 16:27     ` Greg Kroah-Hartman
2021-08-16 17:49       ` Ben Hutchings
2021-08-16 18:09         ` [PATCH 5.10 1/5] net: dsa: microchip: Fix probing KSZ87xx switch with DT node for host port Ben Hutchings
2021-08-16 18:09         ` [PATCH 5.10 2/5] net: dsa: microchip: ksz8795: Fix PVID tag insertion Ben Hutchings
2021-08-16 18:09         ` [PATCH 5.10 3/5] net: dsa: microchip: ksz8795: Reject unsupported VLAN configuration Ben Hutchings
2021-08-16 18:09         ` [PATCH 5.10 4/5] net: dsa: microchip: ksz8795: Fix VLAN untagged flag change on deletion Ben Hutchings
2021-08-16 18:09         ` [PATCH 5.10 5/5] net: dsa: microchip: ksz8795: Use software untagging on CPU port Ben Hutchings
2021-08-16 19:22         ` [PATCH 5.10 52/96] net: dsa: microchip: ksz8795: Fix VLAN filtering Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 53/96] net: Fix memory leak in ieee802154_raw_deliver Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 54/96] net: igmp: fix data-race in igmp_ifc_timer_expire() Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 55/96] net: dsa: lan9303: fix broken backpressure in .port_fdb_dump Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 56/96] net: dsa: lantiq: " Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 57/96] net: dsa: sja1105: " Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 58/96] net: bridge: validate the NUD_PERMANENT bit when adding an extern_learn FDB entry Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 59/96] net: bridge: fix flags interpretation for extern learn fdb entries Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 60/96] net: bridge: fix memleak in br_add_if() Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 61/96] net: linkwatch: fix failure to restore device state across suspend/resume Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 62/96] tcp_bbr: fix u32 wrap bug in round logic if bbr_init() called after 2B packets Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 63/96] net: igmp: increase size of mr_ifc_count Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 64/96] drm/i915: Only access SFC_DONE when media domain is not fused off Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 65/96] xen/events: Fix race in set_evtchn_to_irq Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 66/96] vsock/virtio: avoid potential deadlock when vsock device remove Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 67/96] nbd: Aovid double completion of a request Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 68/96] arm64: efi: kaslr: Fix occasional random alloc (and boot) failure Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 69/96] efi/libstub: arm64: Force Image reallocation if BSS was not reserved Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 70/96] efi/libstub: arm64: Relax 2M alignment again for relocatable kernels Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 71/96] powerpc/kprobes: Fix kprobe Oops happens in booke Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 72/96] x86/tools: Fix objdump version check again Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 73/96] genirq: Provide IRQCHIP_AFFINITY_PRE_STARTUP Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 74/96] x86/msi: Force affinity setup before startup Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 75/96] x86/ioapic: " Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 76/96] x86/resctrl: Fix default monitoring groups reporting Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 77/96] genirq/msi: Ensure deactivation on teardown Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 78/96] genirq/timings: Prevent potential array overflow in __irq_timings_store() Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 79/96] PCI/MSI: Enable and mask MSI-X early Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 80/96] PCI/MSI: Mask all unused MSI-X entries Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 81/96] PCI/MSI: Enforce that MSI-X table entry is masked for update Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 82/96] PCI/MSI: Enforce MSI[X] entry updates to be visible Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 83/96] PCI/MSI: Do not set invalid bits in MSI mask Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 84/96] PCI/MSI: Correct misleading comments Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 85/96] PCI/MSI: Use msi_mask_irq() in pci_msi_shutdown() Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 86/96] PCI/MSI: Protect msi_desc::masked for multi-MSI Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 87/96] powerpc/smp: Fix OOPS in topology_init() Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 88/96] efi/libstub: arm64: Double check image alignment at entry Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 89/96] KVM: VMX: Use current VMCS to query WAITPKG support for MSR emulation Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 90/96] KVM: nVMX: Use vmx_need_pf_intercept() when deciding if L0 wants a #PF Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 91/96] vboxsf: Add vboxsf_[create|release]_sf_handle() helpers Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 92/96] vboxsf: Add support for the atomic_open directory-inode op Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 93/96] ceph: add some lockdep assertions around snaprealm handling Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 94/96] ceph: clean up locking annotation for ceph_get_snap_realm and __lookup_snap_realm Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 95/96] ceph: take snap_empty_lock atomically with snaprealm refcount change Greg Kroah-Hartman
2021-08-16 13:02 ` [PATCH 5.10 96/96] vmlinux.lds.h: Handle clangs module.{c,d}tor sections Greg Kroah-Hartman

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=20210816125435.333947697@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=emilne@redhat.com \
    --cc=jsmart2021@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --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;
as well as URLs for NNTP newsgroup(s).