Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Cc: linux-s390@vger.kernel.org,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>
Subject: Re: [PATCH v2] s390/debug: Fix NULL pointer dereference in debug_info_copy()
Date: Tue, 22 Sep 2026 12:35:01 +0200	[thread overview]
Message-ID: <20260922103501.10121Aba-hca@linux.ibm.com> (raw)
In-Reply-To: <20260916160626.1988684-1-zaslonko@linux.ibm.com>

On Wed, Sep 16, 2026 at 06:06:26PM +0200, Mikhail Zaslonko wrote:
> 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>
> ---
> v2:
> - Different approach: check the areas pointer in debug_info_copy()
>   instead of zeroing nr_areas/pages_per_area in debug_register_static().
>   Zeroing nr_areas made debug_info_alloc() return ZERO_SIZE_PTR for
>   active_pages/active_entries, which debug_to_act_entry() dereferences
>   before debug_prev_entry() checks id->areas.
>   Checking the pointer also matches what all other readers in this file
>   already do.
> - v1: https://lore.kernel.org/all/20260910104525.3788362-1-zaslonko@linux.ibm.com/
> 
>  arch/s390/kernel/debug.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks!

      parent reply	other threads:[~2026-09-22 10:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 16:06 [PATCH v2] s390/debug: Fix NULL pointer dereference in debug_info_copy() Mikhail Zaslonko
2026-09-16 16:16 ` sashiko-bot
2026-09-18 10:44 ` Heiko Carstens
2026-09-22 10:30   ` Peter Oberparleiter
2026-09-22 10:35 ` Heiko Carstens [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260922103501.10121Aba-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=oberpar@linux.ibm.com \
    --cc=zaslonko@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox