linux-stable/drivers
Harald Freudenberger 2062e3f1f2 s390/ap: Fix crash in AP internal function modify_bitmap()
commit d4f9d5a99a upstream.

A system crash like this

  Failing address: 200000cb7df6f000 TEID: 200000cb7df6f403
  Fault in home space mode while using kernel ASCE.
  AS:00000002d71bc007 R3:00000003fe5b8007 S:000000011a446000 P:000000015660c13d
  Oops: 0038 ilc:3 [#1] PREEMPT SMP
  Modules linked in: mlx5_ib ...
  CPU: 8 PID: 7556 Comm: bash Not tainted 6.9.0-rc7 #8
  Hardware name: IBM 3931 A01 704 (LPAR)
  Krnl PSW : 0704e00180000000 0000014b75e7b606 (ap_parse_bitmap_str+0x10e/0x1f8)
  R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:2 PM:0 RI:0 EA:3
  Krnl GPRS: 0000000000000001 ffffffffffffffc0 0000000000000001 00000048f96b75d3
  000000cb00000100 ffffffffffffffff ffffffffffffffff 000000cb7df6fce0
  000000cb7df6fce0 00000000ffffffff 000000000000002b 00000048ffffffff
  000003ff9b2dbc80 200000cb7df6fcd8 0000014bffffffc0 000000cb7df6fbc8
  Krnl Code: 0000014b75e7b5fc: a7840047            brc     8,0000014b75e7b68a
  0000014b75e7b600: 18b2                lr      %r11,%r2
  #0000014b75e7b602: a7f4000a            brc     15,0000014b75e7b616
  >0000014b75e7b606: eb22d00000e6        laog    %r2,%r2,0(%r13)
  0000014b75e7b60c: a7680001            lhi     %r6,1
  0000014b75e7b610: 187b                lr      %r7,%r11
  0000014b75e7b612: 84960021            brxh    %r9,%r6,0000014b75e7b654
  0000014b75e7b616: 18e9                lr      %r14,%r9
  Call Trace:
  [<0000014b75e7b606>] ap_parse_bitmap_str+0x10e/0x1f8
  ([<0000014b75e7b5dc>] ap_parse_bitmap_str+0xe4/0x1f8)
  [<0000014b75e7b758>] apmask_store+0x68/0x140
  [<0000014b75679196>] kernfs_fop_write_iter+0x14e/0x1e8
  [<0000014b75598524>] vfs_write+0x1b4/0x448
  [<0000014b7559894c>] ksys_write+0x74/0x100
  [<0000014b7618a440>] __do_syscall+0x268/0x328
  [<0000014b761a3558>] system_call+0x70/0x98
  INFO: lockdep is turned off.
  Last Breaking-Event-Address:
  [<0000014b75e7b636>] ap_parse_bitmap_str+0x13e/0x1f8
  Kernel panic - not syncing: Fatal exception: panic_on_oops

occured when /sys/bus/ap/a[pq]mask was updated with a relative mask value
(like +0x10-0x12,+60,-90) with one of the numeric values exceeding INT_MAX.

The fix is simple: use unsigned long values for the internal variables. The
correct checks are already in place in the function but a simple int for
the internal variables was used with the possibility to overflow.

Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-16 13:23:45 +02:00
..
accessibility License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
acpi ACPI: disable -Wstringop-truncation 2024-06-16 13:23:26 +02:00
amba amba: bus: fix refcount leak 2023-09-23 10:48:09 +02:00
android binder: fix max_thread type inconsistency 2024-06-16 13:23:38 +02:00
ata ata: pata_legacy: make legacy_exit() work again 2024-06-16 13:23:38 +02:00
atm atm: idt77252: fix a memleak in open_card_ubr0 2024-02-23 08:12:53 +01:00
auxdisplay
base PM: sleep: wakeirq: fix wake irq warning in system suspend 2024-04-13 12:50:05 +02:00
bcma bcma: Fix memory leak for internally-handled cores 2021-09-22 11:47:55 +02:00
block null_blk: Fix the WARNING: modpost: missing MODULE_DESCRIPTION() 2024-06-16 13:23:35 +02:00
bluetooth Bluetooth: btintel: Fixe build regression 2024-04-13 12:50:17 +02:00
bus bus: tegra-aconnect: Update dependency to ARCH_TEGRA 2024-03-26 18:22:35 -04:00
cdrom
char ppdev: Add an error check in register_device 2024-06-16 13:23:33 +02:00
clk clk: qcom: mmcc-msm8974: fix terminating of frequency table arrays 2024-04-13 12:50:05 +02:00
clocksource clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware 2023-11-28 16:46:31 +00:00
connector connector: fix unsafe usage of ->real_parent 2019-03-19 13:12:38 +01:00
cpufreq
cpuidle sched,idle,rcu: Push rcu_idle deeper into the idle path 2023-10-25 11:16:26 +02:00
crypto crypto: qat - Fix ADF_DEV_RESET_SYNC memory leak 2024-06-16 13:23:44 +02:00
dax mm/huge_memory: fix vmf_insert_pfn_{pmd, pud}() crash, handle unaligned addresses 2019-05-22 07:37:40 +02:00
dca dca: make function dca_common_get_tag static 2018-04-23 21:02:41 -04:00
devfreq PM / devfreq: Fix leak in devfreq_dev_release() 2023-09-23 10:48:10 +02:00
dio
dma dmaengine: idma64: Add check for dma_set_max_seg_size 2024-06-16 13:23:32 +02:00
dma-buf dma-buf/sw-sync: don't enable IRQ from sync_print_obj() 2024-06-16 13:23:37 +02:00
edac
eisa
extcon extcon: max8997: select IRQ_DOMAIN instead of depending on it 2024-06-16 13:23:33 +02:00
firewire firewire: nosy: ensure user_length is taken into account when fetching packet contents 2024-05-17 11:42:42 +02:00
firmware firmware: dmi-id: add a release callback function 2024-06-16 13:23:32 +02:00
fmc treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
fpga
fsi fsi: master-ast-cf: Add MODULE_FIRMWARE macro 2023-09-23 10:47:57 +02:00
gnss gnss: sirf: fix error return code in sirf_probe() 2020-06-22 09:05:28 +02:00
gpio gpio: crystalcove: Use -ENOTSUPP consistently 2024-05-17 11:42:41 +02:00
gpu drm/msm/dpu: use kms stored hw mdp block 2024-06-16 13:23:34 +02:00
hid HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up 2024-05-02 16:17:14 +02:00
hsi
hv
hwmon hwmon: (amc6821) add of_match table 2024-04-13 12:50:06 +02:00
hwspinlock hwspinlock: Fix incorrect return pointers 2018-07-30 20:54:51 -07:00
hwtracing intel_th: pci: Add Meteor Lake-S CPU support 2024-06-16 13:23:44 +02:00
i2c i2c: smbus: fix NULL function pointer dereference 2024-05-02 16:17:14 +02:00
ide
idle intel_idle: Disable IBRS during long idle 2022-11-23 07:53:45 +01:00
iio
infiniband RDMA/IPoIB: Fix format truncation compilation errors 2024-06-16 13:23:31 +02:00
input Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation 2024-06-16 13:23:34 +02:00
iommu iommu/amd: Mark interrupt as managed 2024-03-26 18:22:35 -04:00
ipack ipack: ipoctal: fix module reference leak 2021-10-06 15:31:25 +02:00
irqchip irqchip/alpine-msi: Fix off-by-one in allocation error path 2024-06-16 13:23:26 +02:00
isdn
leds leds: trigger: panic: Don't register panic notifier if creating the trigger failed 2024-02-23 08:12:50 +01:00
lightnvm lightnvm: disable the subsystem 2022-05-01 17:00:38 +02:00
macintosh macintosh/via-macii: Fix "BUG: sleeping function called from invalid context" 2024-06-16 13:23:27 +02:00
mailbox
mcb
md md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING 2024-06-16 13:23:39 +02:00
media media: v4l2-core: hold videodev_lock until dev reg, finishes 2024-06-16 13:23:39 +02:00
memory memory: of: Fix refcount leak bug in of_get_ddr_timings() 2022-10-26 13:19:28 +02:00
memstick
message scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition 2023-05-30 12:42:09 +01:00
mfd mfd: syscon: Call of_node_put() only when of_parse_phandle() takes a ref 2024-03-26 18:22:40 -04:00
misc VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler() 2024-04-13 12:50:17 +02:00
mmc mmc: core: Do not force a retune before RPMB switch 2024-06-16 13:23:38 +02:00
mtd mtd: rawnand: hynix: fixed typo 2024-06-16 13:23:29 +02:00
mux
net wifi: rtl8xxxu: Fix the TX power of RTL8192CU, RTL8723AU 2024-06-16 13:23:39 +02:00
nfc NFC: trf7970a: disable all regulators on removal 2024-05-02 16:17:11 +02:00
ntb
nubus nubus: Set default dma mask for nubus_board devices 2018-07-23 15:07:12 +02:00
nvdimm
nvme nvmet: fix ns enable/disable possible hang 2024-06-16 13:23:36 +02:00
nvmem
of of: unittest: Fix of_count_phandle_with_args() expected value message 2024-01-25 14:33:36 -08:00
opp
oprofile
parisc parisc: iosapic.c: Fix sparse warnings 2023-10-10 21:44:58 +02:00
parport
pci PCI/PM: Drain runtime-idle callbacks before driver removal 2024-04-13 12:50:06 +02:00
pcmcia pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() 2023-11-20 10:29:20 +01:00
perf
phy
pinctrl pinctrl: devicetree: fix refcount leak in pinctrl_dt_to_map() 2024-05-17 11:42:37 +02:00
platform platform/x86: intel_telemetry: Fix kernel doc descriptions 2023-12-20 15:38:02 +01:00
pnp
power power: supply: cros_usbpd: provide ID table for avoiding fallback match 2024-06-16 13:23:25 +02:00
powercap
pps
ps3
ptp
pwm pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume 2023-11-20 10:29:20 +01:00
rapidio
ras
regulator regulator: pwm-regulator: Add validity checks in continuous .get_voltage 2024-03-01 13:06:09 +01:00
remoteproc remoteproc: qcom: wcnss: Fix handling of IRQs 2022-08-25 11:15:21 +02:00
reset
rpmsg
rtc rtc: mt6397: select IRQ_DOMAIN instead of depending on it 2024-03-26 18:22:42 -04:00
s390 s390/ap: Fix crash in AP internal function modify_bitmap() 2024-06-16 13:23:45 +02:00
sbus drivers/sbus/char: add of_node_put() 2018-12-21 14:15:17 +01:00
scsi scsi: qedf: Ensure the copied buf is NUL terminated 2024-06-16 13:23:28 +02:00
sfi
sh
siox
slimbus slimbus: core: Remove usage of the deprecated ida_simple_xx() API 2024-04-13 12:50:06 +02:00
sn
soc soc: fsl: qbman: Use raw spinlock for cgr_lock 2024-04-13 12:50:07 +02:00
soundwire soundwire: bus_type: fix remove and shutdown support 2022-08-25 11:15:15 +02:00
spi spi: Don't mark message DMA mapped when no transfer in it is 2024-06-16 13:23:36 +02:00
spmi
ssb treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
staging greybus: arche-ctrl: move device table to its right location 2024-06-16 13:23:32 +02:00
target scsi: target: Fix SELinux error when systemd-modules loads the target module 2024-05-17 11:42:40 +02:00
tc
tee tee: add overflow check in register_shm_helper() 2022-08-25 11:15:48 +02:00
thermal thermal: core: prevent potential string overflow 2023-11-20 10:29:17 +01:00
thunderbolt
tty serial: sh-sci: protect invalidating RXDMA on shutdown 2024-06-16 13:23:34 +02:00
uio uio: Fix use-after-free in uio_open 2024-01-25 14:33:30 -08:00
usb usb: gadget: u_audio: Clear uac pointer when freed. 2024-06-16 13:23:33 +02:00
uwb
vfio vfio/platform: Disable virqfds on cleanup 2024-04-13 12:50:06 +02:00
vhost vhost: Add smp_rmb() in vhost_vq_avail_empty() 2024-05-02 16:17:08 +02:00
video fbdev: savage: Handle err return when savagefb_check_var failed 2024-06-16 13:23:39 +02:00
virt
virtio virtio: delete vq in vp_find_vqs_msix() when request_irq() fails 2024-06-16 13:23:36 +02:00
visorbus
vlynq
vme vme: Fix error not catched in fake_init() 2023-01-18 11:30:28 +01:00
w1 w1: fix loop in w1_fini() 2023-08-11 11:45:11 +02:00
watchdog
xen xen/events: fix delayed eoi list handling 2023-11-28 16:46:33 +00:00
zorro
Kconfig
Makefile