linux/arch/s390
Pengpeng Hou 1d6ceb529a s390/debug: Reject zero-length input before trimming a newline
[ Upstream commit c366a7b5ed ]

debug_get_user_string() copies the userspace buffer into a newly
allocated NUL-terminated buffer and then unconditionally looks at
buffer[user_len - 1] to strip a trailing newline.

A zero-length write reaches this helper unchanged, so the newline trim
reads before the start of the allocated buffer.

Reject empty writes before accessing the last input byte.

Fixes: 66a464dbc8 ("[PATCH] s390: debug feature changes")
Cc: stable@vger.kernel.org
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Tested-by: Vasily Gorbik <gor@linux.ibm.com>
Link: https://lore.kernel.org/r/20260417073530.96002-1-pengpeng@iscas.ac.cn
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-06-01 17:35:45 +02:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot s390/boot: Remove alt_stfle_fac_list from decompressor 2024-06-16 13:39:41 +02:00
configs s390: update defconfigs 2021-09-15 14:29:21 +02:00
crypto crypto: s390/aes - Fix buffer overread in CTR mode 2024-02-23 08:54:24 +01:00
hypfs s390/hypfs: Enable limited access during lockdown 2025-08-28 16:24:39 +02:00
include s390/barrier: Make array_index_mask_nospec() __always_inline 2026-04-18 10:33:27 +02:00
kernel s390/debug: Reject zero-length input before trimming a newline 2026-06-01 17:35:45 +02:00
kvm KVM: s390: Don't use %pK through tracepoints 2025-05-02 07:44:36 +02:00
lib s390/xor: Fix xor_xc_2() inline assembly constraints 2026-06-01 17:35:08 +02:00
mm mm/ptdump: take the memory hotplug lock inside ptdump_walk_pgd() 2025-08-28 16:24:32 +02:00
net s390/bpf: Store backchain even for leaf progs 2025-06-27 11:05:13 +01:00
pci s390/pci: Handle futile config accesses of disabled devices directly 2026-03-04 07:20:29 -05:00
purgatory s390/purgatory: Add -Wno-default-const-init-unsafe to KBUILD_CFLAGS 2026-03-04 07:19:57 -05:00
tools s390/disassembler: add instructions 2021-07-27 09:39:19 +02:00
Kbuild s390/numa: move code to arch/s390/kernel 2020-08-11 18:16:55 +02:00
Kconfig s390: remove unneeded 'select BUILD_BIN2C' 2022-07-07 17:53:27 +02:00
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile Makefile.compiler: replace cc-ifversion with compiler-specific macros 2025-12-07 06:09:32 +09:00