Linux s390 Architecture development
 help / color / mirror / Atom feed
* [PATCH] s390/debug: Reject NULL debug info in debug_dump()
@ 2026-09-16 16:53 Mikhail Zaslonko
  2026-09-16 17:02 ` sashiko-bot
  2026-09-18 13:09 ` Heiko Carstens
  0 siblings, 2 replies; 3+ messages in thread
From: Mikhail Zaslonko @ 2026-09-16 16:53 UTC (permalink / raw)
  To: linux-s390
  Cc: Heiko Carstens, Alexander Gordeev, Vasily Gorbik,
	Peter Oberparleiter

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>
---
 arch/s390/kernel/debug.c | 3 +++
 1 file changed, 3 insertions(+)

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;
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] s390/debug: Reject NULL debug info in debug_dump()
  2026-09-16 16:53 [PATCH] s390/debug: Reject NULL debug info in debug_dump() Mikhail Zaslonko
@ 2026-09-16 17:02 ` sashiko-bot
  2026-09-18 13:09 ` Heiko Carstens
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-09-16 17:02 UTC (permalink / raw)
  To: Mikhail Zaslonko
  Cc: linux-s390, Heiko Carstens, Christian Borntraeger, Vasily Gorbik,
	Alexander Gordeev

> 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>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260916165330.2309909-1-zaslonko@linux.ibm.com?part=1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] s390/debug: Reject NULL debug info in debug_dump()
  2026-09-16 16:53 [PATCH] s390/debug: Reject NULL debug info in debug_dump() Mikhail Zaslonko
  2026-09-16 17:02 ` sashiko-bot
@ 2026-09-18 13:09 ` Heiko Carstens
  1 sibling, 0 replies; 3+ messages in thread
From: Heiko Carstens @ 2026-09-18 13:09 UTC (permalink / raw)
  To: Mikhail Zaslonko
  Cc: linux-s390, Alexander Gordeev, Vasily Gorbik, Peter Oberparleiter

On Wed, Sep 16, 2026 at 06:53:30PM +0200, Mikhail Zaslonko wrote:
> 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>
> ---
>  arch/s390/kernel/debug.c | 3 +++
>  1 file changed, 3 insertions(+)

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-18 13:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 16:53 [PATCH] s390/debug: Reject NULL debug info in debug_dump() Mikhail Zaslonko
2026-09-16 17:02 ` sashiko-bot
2026-09-18 13:09 ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox