diff options
| author | 2026-09-16 18:53:30 +0200 | |
|---|---|---|
| committer | 2026-09-22 12:24:22 +0200 | |
| commit | 4467df89dbca6a3e9dbc343a315324bb192603d6 (patch) | |
| tree | 66ef63d5ec2244bca1330d1650832d59dd78c5df | |
| parent | s390/cmf: Fix virtual vs physical address confusion (diff) | |
s390/debug: Reject NULL debug info in debug_dump()
debug_dump() passes id on to debug_info_copy(), which dereferences
in->name unchecked. debug_unregister(), debug_set_size() and
debug_register_view() guard against a NULL id but debug_dump() does not.
Nothing reaches this today, but add the check for consistency.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/all/20260910110147.96E851F000FF@smtp.kernel.org/
Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
| -rw-r--r-- | arch/s390/kernel/debug.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index b5bf8284dbfc..354ce78fc0cf 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c @@ -823,6 +823,9 @@ ssize_t debug_dump(debug_info_t *id, struct debug_view *view, file_private_info_t *p_info; size_t size, offset = 0; + if (!id) + return -EINVAL; + /* Need space for '\0' byte */ if (buf_size < 1) return 0; |
