linux/arch/s390/pci
Niklas Schnelle 8ac60ae2a3 s390/pci: Fix leak of uninitialized kernel data in SCLP report
While report_error_write() checks that the provided buffer is at least
as large as the header struct, but not that it is large enough to
contain the report with the length claimed by report->length. If
user-space provides a short buffer, meaning a larger report->length than
the actually written payload, up to around 4K of kernel data from past
the kmalloc(len + 1) sized buffer allocated in kernfs_fop_write_iter()
will leak into the SCLP report.

However, as the entity processing the SCLP is privileged and able to
access at least the page including the report, this does not leak data
that entity could not access but it is still an out of bounds read and
a malformed error report that should be rejected.

Fixes: 368704a65b ("s390/pci: add report_error attribute")
Cc: stable@vger.kernel.org
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2026-08-31 16:25:38 +02:00
..
Makefile s390/pci: Enable CONTEXT_ANALYSIS 2026-08-11 16:41:22 +02:00
pci_bus.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pci_bus.h s390/pci: Fix cyclic dead-lock in zpci_zdev_put() and zpci_scan_devices() 2025-12-14 11:03:58 +01:00
pci_clp.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
pci_debug.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
pci_event.c s390 updates for 7.3 merge window 2026-08-23 10:26:44 -07:00
pci_fixup.c s390/pci: Support mmap() of PCI resources except for ISM devices 2025-03-21 14:54:16 -05:00
pci_insn.c s390: Remove superfluous newlines from inline assemblies 2025-09-29 13:52:08 +02:00
pci_iov.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
pci_iov.h s390/pci: Fix handling of isolated VFs 2025-02-11 19:35:08 +01:00
pci_irq.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
pci_kvm_hook.c s390: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
pci_mmio.c s390/pci: Fix s390_pci_mmio_write syscall error return without MIO 2026-07-31 13:31:19 +02:00
pci_report.c s390: Remove KMSG_COMPONENT macro 2025-11-24 11:45:21 +01:00
pci_report.h s390/pci: Report PCI error recovery results via SCLP 2024-12-16 16:14:26 +01:00
pci_sysfs.c s390/pci: Fix leak of uninitialized kernel data in SCLP report 2026-08-31 16:25:38 +02:00
pci.c s390 updates for 7.3 merge window 2026-08-23 10:26:44 -07:00