aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMikhail Zaslonko <zaslonko@linux.ibm.com>2026-09-16 18:06:26 +0200
committerHeiko Carstens <hca@linux.ibm.com>2026-09-22 12:38:01 +0200
commit012bfcd5a51082d5a65f096dfb9ca652b5267965 (patch)
treea63562184a49d822e540995712208e6bab171915
parents390/debug: Do not register views for failed static debug areas (diff)
s390/debug: Fix NULL pointer dereference in debug_info_copy()
When debug_register_static() fails, it clears areas, active_pages and active_entries but leaves the area bounds unchanged. Copying such an area, either by opening its view file or via debug_dump(), makes debug_info_copy() dereference the NULL pointers. Skip the copy loop when the source has no areas. Closes: https://lore.kernel.org/r/20260903132123.12F271F00A3F@smtp.kernel.org Fixes: d72541f94512 ("s390/debug: add early tracing support") Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-rw-r--r--arch/s390/kernel/debug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 142dc1487187..3b68f5c58333 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -434,7 +434,8 @@ static debug_info_t *debug_info_copy(debug_info_t *in, int mode)
debug_info_free(rc);
} while (1);
- if (mode == NO_AREAS)
+ /* debug_register_static() failure leaves areas NULL, bounds intact */
+ if (mode == NO_AREAS || !in->areas)
goto out;
for (i = 0; i < in->nr_areas; i++) {