linux-stable/drivers
Harald Freudenberger d67fce6b13 s390/ap: fix AP bus crash on early config change callback invocation
commit e14aec2302 upstream.

Fix kernel crash in AP bus code caused by very early invocation of the
config change callback function via SCLP.

After a fresh IML of the machine the crypto cards are still offline and
will get switched online only with activation of any LPAR which has the
card in it's configuration. A crypto card coming online is reported
to the LPAR via SCLP and the AP bus offers a callback function to get
this kind of information. However, it may happen that the callback is
invoked before the AP bus init function is complete. As the callback
triggers a synchronous AP bus scan, the scan may already run but some
internal states are not initialized by the AP bus init function resulting
in a crash like this:

  [   11.635859] Unable to handle kernel pointer dereference in virtual kernel address space
  [   11.635861] Failing address: 0000000000000000 TEID: 0000000000000887
  [   11.635862] Fault in home space mode while using kernel ASCE.
  [   11.635864] AS:00000000894c4007 R3:00000001fece8007 S:00000001fece7800 P:000000000000013d
  [   11.635879] Oops: 0004 ilc:1 [#1] SMP
  [   11.635882] Modules linked in:
  [   11.635884] CPU: 5 PID: 42 Comm: kworker/5:0 Not tainted 6.6.0-rc3-00003-g4dbf7cdc6b42 #12
  [   11.635886] Hardware name: IBM 3931 A01 751 (LPAR)
  [   11.635887] Workqueue: events_long ap_scan_bus
  [   11.635891] Krnl PSW : 0704c00180000000 0000000000000000 (0x0)
  [   11.635895]            R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3
  [   11.635897] Krnl GPRS: 0000000001000a00 0000000000000000 0000000000000006 0000000089591940
  [   11.635899]            0000000080000000 0000000000000a00 0000000000000000 0000000000000000
  [   11.635901]            0000000081870c00 0000000089591000 000000008834e4e2 0000000002625a00
  [   11.635903]            0000000081734200 0000038000913c18 000000008834c6d6 0000038000913ac8
  [   11.635906] Krnl Code:>0000000000000000: 0000                illegal
  [   11.635906]            0000000000000002: 0000                illegal
  [   11.635906]            0000000000000004: 0000                illegal
  [   11.635906]            0000000000000006: 0000                illegal
  [   11.635906]            0000000000000008: 0000                illegal
  [   11.635906]            000000000000000a: 0000                illegal
  [   11.635906]            000000000000000c: 0000                illegal
  [   11.635906]            000000000000000e: 0000                illegal
  [   11.635915] Call Trace:
  [   11.635916]  [<0000000000000000>] 0x0
  [   11.635918]  [<000000008834e4e2>] ap_queue_init_state+0x82/0xb8
  [   11.635921]  [<000000008834ba1c>] ap_scan_domains+0x6fc/0x740
  [   11.635923]  [<000000008834c092>] ap_scan_adapter+0x632/0x8b0
  [   11.635925]  [<000000008834c3e4>] ap_scan_bus+0xd4/0x288
  [   11.635927]  [<00000000879a33ba>] process_one_work+0x19a/0x410
  [   11.635930] Discipline DIAG cannot be used without z/VM
  [   11.635930]  [<00000000879a3a2c>] worker_thread+0x3fc/0x560
  [   11.635933]  [<00000000879aea60>] kthread+0x120/0x128
  [   11.635936]  [<000000008792afa4>] __ret_from_fork+0x3c/0x58
  [   11.635938]  [<00000000885ebe62>] ret_from_fork+0xa/0x30
  [   11.635942] Last Breaking-Event-Address:
  [   11.635942]  [<000000008834c6d4>] ap_wait+0xcc/0x148

This patch improves the ap_bus_force_rescan() function which is
invoked by the config change callback by checking if a first
initial AP bus scan has been done. If not, the force rescan request
is simple ignored. Anyhow it does not make sense to trigger AP bus
re-scans even before the very first bus scan is complete.

Cc: stable@vger.kernel.org
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 17:15:12 +00:00
..
accel accel/habanalabs/gaudi2: Fix incorrect string length computation in gaudi2_psoc_razwi_get_engines() 2023-11-20 11:57:01 +01:00
accessibility
acpi ACPI: FPDT: properly handle invalid FPDT subtables 2023-11-28 17:15:06 +00:00
amba amba: bus: fix refcount leak 2023-09-13 09:53:44 +02:00
android binder: fix memory leaks of spam and pending work 2023-10-19 23:11:04 +02:00
ata ata: pata_parport: fit3: implement IDE command set registers 2023-11-08 14:08:57 +01:00
atm atm: iphase: Do PCI error checks on own line 2023-11-28 17:14:48 +00:00
auxdisplay
base driver core: Release all resources during unbind before updating device links 2023-11-28 17:15:07 +00:00
bcma
block virtio-blk: fix implicit overflow on virtio_max_dma_size 2023-11-28 17:14:50 +00:00
bluetooth Bluetooth: btusb: Add date->evt_skb is NULL check 2023-11-28 17:14:43 +00:00
bus bus: ti-sysc: Fix SYSC_QUIRK_SWSUP_SIDLE_ACT handling for uart wake-up 2023-10-06 13:16:03 +02:00
cdrom
cdx
char parisc/agp: Use 64-bit LE values in SBA IOMMU PDIR table 2023-11-28 17:15:03 +00:00
clk clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks 2023-11-28 17:15:04 +00:00
clocksource clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware 2023-11-28 17:14:41 +00:00
comedi Revert "comedi: add HAS_IOPORT dependencies" 2023-09-23 11:14:37 +02:00
connector
counter counter: microchip-tcb-capture: Fix the use of internal GCLK logic 2023-10-19 23:11:07 +02:00
cpufreq cpufreq: stats: Fix buffer overflow detection in trans_stats() 2023-11-28 17:15:03 +00:00
cpuidle powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT 2023-09-13 09:53:32 +02:00
crypto crypto: hisilicon/qm - prevent soft lockup in receive loop 2023-11-28 17:14:49 +00:00
cxl cxl/port: Fix delete_endpoint() vs parent unregistration race 2023-11-28 17:15:09 +00:00
dax
dca
devfreq PM / devfreq: rockchip-dfi: Make pmu regmap mandatory 2023-11-20 11:56:51 +01:00
dio
dma dmaengine: stm32-mdma: correct desc prep when channel running 2023-11-28 17:15:08 +00:00
dma-buf dma-buf: add dma_fence_timestamp helper 2023-10-19 23:11:07 +02:00
edac EDAC/igen6: Fix the issue of no error events 2023-09-13 09:53:29 +02:00
eisa
extcon extcon: cht_wc: add POWER_SUPPLY dependency 2023-09-13 09:53:38 +02:00
firewire scsi: sd: Introduce manage_shutdown device flag 2023-11-02 09:36:55 +01:00
firmware firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit 2023-11-28 17:15:05 +00:00
fpga
fsi fsi: aspeed: Reset master errors after CFAM reset 2023-09-13 09:53:40 +02:00
gnss
gpio gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound 2023-11-28 17:14:47 +00:00
gpu i915/perf: Fix NULL deref bugs with drm_dbg() calls 2023-11-28 17:14:58 +00:00
greybus
hid hid: lenovo: Resend all settings on reset_resume for compact keyboards 2023-11-28 17:15:07 +00:00
hsi
hte hte: tegra: Fix missing error code in tegra_hte_test_probe() 2023-11-20 11:56:58 +01:00
hv Drivers: hv: vmbus: Don't dereference ACPI root object handle 2023-09-13 09:53:48 +02:00
hwmon hwmon: (sch5627) Disallow write access if virtual registers are locked 2023-11-20 11:56:58 +01:00
hwspinlock hwspinlock: qcom: add missing regmap config for SFPB MMIO implementation 2023-09-19 12:30:23 +02:00
hwtracing coresight: tmc-etr: Disable warnings for allocation failures 2023-11-08 14:08:55 +01:00
i2c i2c: designware: Disable TX_EMPTY irq while waiting for block length byte 2023-11-28 17:15:12 +00:00
i3c i3c: master: svc: fix random hot join failure since timeout error 2023-11-28 17:15:09 +00:00
idle
iio iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe() 2023-11-28 17:14:49 +00:00
infiniband RDMA/hfi1: Use FIELD_GET() to extract Link Width 2023-11-28 17:14:47 +00:00
input Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() 2023-11-20 11:57:21 +01:00
interconnect interconnect: fix error handling in qnoc_probe() 2023-11-20 11:57:16 +01:00
iommu iommufd: Fix missing update of domains_itree after splitting iopt_area 2023-11-28 17:15:01 +00:00
ipack
irqchip irqchip/sifive-plic: Fix syscore registration for multi-socket systems 2023-11-20 11:56:45 +01:00
isdn
leds leds: trigger: netdev: Move size check in set_device_name 2023-11-28 17:15:06 +00:00
macintosh
mailbox mailbox: qcom-ipcc: fix incorrect num_chans counting 2023-09-19 12:30:13 +02:00
mcb mcb: fix error handling for different scenarios when parsing 2023-11-28 17:15:08 +00:00
md dm crypt: account large pages in cc->n_allocated_pages 2023-11-28 17:15:01 +00:00
media media: venus: hfi: add checks to perform sanity on queue pointers 2023-11-28 17:14:58 +00:00
memory memory: tegra: Set BPMP msg flags to reset IPC channels 2023-11-20 11:57:06 +01:00
memstick
message
mfd mfd: qcom-spmi-pmic: Fix revid implementation 2023-11-28 17:15:06 +00:00
misc misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller 2023-11-28 17:14:48 +00:00
mmc mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A 2023-11-28 17:15:04 +00:00
most
mtd mtd: cfi_cmdset_0001: Byte swap OTP info 2023-11-28 17:15:08 +00:00
mux
net wifi: wilc1000: use vmm_table as array in wilc struct 2023-11-28 17:15:04 +00:00
nfc
ntb ntb: Fix calculation ntb_transport_tx_free_entry() 2023-09-13 09:53:53 +02:00
nubus
nvdimm nd_btt: Make BTT lanes preemptible 2023-11-20 11:57:08 +01:00
nvme nvme: fix error-handling for io_uring nvme-passthrough 2023-11-20 11:57:23 +01:00
nvmem nvmem: imx: correct nregs for i.MX6UL 2023-11-02 09:36:58 +01:00
of of: address: Fix address translation when address-size is greater than 2 2023-11-28 17:14:43 +00:00
opp
parisc parisc/power: Fix power soft-off when running on qemu 2023-11-28 17:15:10 +00:00
parport
pci PCI: Lengthen reset delay for VideoPropulsion Torrent QN16e card 2023-11-28 17:15:09 +00:00
pcmcia pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 11:57:19 +01:00
peci
perf drivers: perf: Check find_first_bit() return value 2023-11-28 17:14:58 +00:00
phy phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs 2023-11-28 17:14:49 +00:00
pinctrl pinctrl: renesas: rzg2l: Make reverse order of enable() for disable() 2023-11-20 11:57:13 +01:00
platform platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e 2023-11-28 17:14:43 +00:00
pnp
power power: supply: core: Use blocking_notifier_call_chain to avoid RCU complaint 2023-11-08 14:09:04 +01:00
powercap powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() 2023-11-28 17:15:03 +00:00
pps
ps3
ptp ptp: annotate data-race around q->head and q->tail 2023-11-28 17:14:55 +00:00
pwm pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume 2023-11-20 11:57:21 +01:00
rapidio
ras
regulator regulator: qcom-rpmh: Fix smps4 regulator for pm8550ve 2023-11-20 11:56:57 +01:00
remoteproc remoteproc: stm32: fix incorrect optional pointers 2023-09-13 09:53:48 +02:00
reset
rpmsg rpmsg: glink: Add check for kstrdup 2023-09-13 09:53:46 +02:00
rtc rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call 2023-11-20 11:57:18 +01:00
s390 s390/ap: fix AP bus crash on early config change callback invocation 2023-11-28 17:15:12 +00:00
sbus
scsi scsi: qla2xxx: Fix system crash due to bad pointer access 2023-11-28 17:14:59 +00:00
sh
siox
slimbus
soc pmdomain: imx: Make imx pgc power domain also set the fwnode 2023-11-28 17:15:09 +00:00
soundwire soundwire: dmi-quirks: update HP Omen match 2023-11-28 17:14:49 +00:00
spi spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies 2023-11-20 11:57:25 +01:00
spmi
ssb
staging media: cedrus: Fix clock/reset sequence 2023-11-20 11:57:20 +01:00
target scsi: target: core: Fix deadlock due to recursive locking 2023-10-10 22:03:00 +02:00
tc
tee tee: amdtee: fix use-after-free vulnerability in amdtee_close_session 2023-10-19 23:11:06 +02:00
thermal thermal: intel: powerclamp: fix mismatch in get function for max_idle 2023-11-28 17:15:05 +00:00
thunderbolt thunderbolt: Apply USB 3.x bandwidth quirk only in software connection manager 2023-11-28 17:14:49 +00:00
tty hvc/xen: fix event channel handling for secondary consoles 2023-11-28 17:15:00 +00:00
ufs scsi: ufs: core: Fix racing issue between ufshcd_mcq_abort() and ISR 2023-11-28 17:14:59 +00:00
uio
usb xhci: Enable RPM on controllers that support low-power states 2023-11-28 17:15:10 +00:00
vdpa vdpa_sim_blk: allocate the buffer zeroed 2023-11-28 17:14:53 +00:00
vfio vfio/mdev: Fix a null-ptr-deref bug for mdev_unregister_parent() 2023-10-06 13:16:01 +02:00
vhost vhost-vdpa: fix use after free in vhost_vdpa_probe() 2023-11-28 17:14:53 +00:00
video fbdev: fsl-diu-fb: mark wr_reg_wa() static 2023-11-20 11:57:25 +01:00
virt virt: sevguest: Fix passing a stack buffer as a scatterlist target 2023-11-20 11:57:18 +01:00
virtio virtio_pci: fix the common cfg map size 2023-11-02 09:36:46 +01:00
vlynq
w1
watchdog sbsa_gwdt: Calculate timeout with 64-bit math 2023-11-28 17:15:12 +00:00
xen xen/events: fix delayed eoi list handling 2023-11-28 17:14:55 +00:00
zorro
Kconfig
Makefile