Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Vasily Gorbik <gor@linux.ibm.com>
To: sashiko-reviews@lists.linux.dev
Cc: Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.vom>,
	Heiko Carstens <hca@linux.ibm.com>,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH 1/2] s390/ipl: Fix NULL deref in kdump without re-IPL parm block
Date: Thu, 13 Aug 2026 13:48:00 +0200	[thread overview]
Message-ID: <ttjpi40@ub.hpns> (raw)
In-Reply-To: <20260813111928.184701F000E9@smtp.kernel.org>

On Thu, Aug 13, 2026 at 11:19:27AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
> 
> Pre-existing issues:
> - [High] NULL pointer dereference in `dump_reipl_run()` when the system is booted without an IPL parameter block.
> - [High] Unbounded `memcpy()` in `reipl_type_init()` causes a heap buffer overflow in the dump kernel.
> --

...

> [Severity: High]
> This is a pre-existing issue, but looking at dump_reipl_run(), if the system
> boots without an IPL parameter block and sets reipl_block_actual to NULL,
> won't this unconditionally dereference it?

That's fixed in patch 2 of the series

> [Severity: High]
> This isn't a bug introduced by this patch, but looking at reipl_type_init(),
> could an untrusted size from the crashed kernel memory overflow the
> PAGE_SIZE buffers here?
> 
> arch/s390/kernel/ipl.c:reipl_type_init() {
>     ...
> 	reipl_block = os_info_old_entry(OS_INFO_REIPL_BLOCK, &size);
> 	if (!reipl_block)
> 		goto out;
> 	/*
> 	 * If we have an OS info reipl block, this will be used
> 	 */
> 	if (reipl_block->pb0_hdr.pbt == IPL_PBT_FCP) {
> 		memcpy(reipl_block_fcp, reipl_block, size);
> 		reipl_type = IPL_TYPE_FCP;
> 	} else if (reipl_block->pb0_hdr.pbt == IPL_PBT_NVME) {
>     ...
> }
> 
> If a malicious primary kernel crafts an os_info payload with a valid
> checksum but a size greater than PAGE_SIZE, wouldn't this cause a heap
> buffer overflow in the dump kernel, preventing the crash dump from being
> collected?

The primary kernel is not an untrusted security boundary for kdump. It
loads the dump kernel and can modify both the dump kernel image and the
data. A malicious primary kernel can therefore already prevent dump
collection or execute arbitrary code in the dump kernel. So, this
finding is outside the kernel threat model.

  reply	other threads:[~2026-08-13 11:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 11:06 [PATCH 0/2] s390/ipl: Fix missing re-IPL parm blocks handling in dump paths Vasily Gorbik
2026-08-13 11:06 ` [PATCH 1/2] s390/ipl: Fix NULL deref in kdump without re-IPL parm block Vasily Gorbik
2026-08-13 11:19   ` sashiko-bot
2026-08-13 11:48     ` Vasily Gorbik [this message]
2026-08-13 11:06 ` [PATCH 2/2] s390/ipl: Fix NULL deref in dump_reipl " Vasily Gorbik
2026-08-13 11:25   ` sashiko-bot
2026-08-13 13:57   ` Mikhail Zaslonko

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=ttjpi40@ub.hpns \
    --to=gor@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.vom \
    --cc=hca@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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