All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Pingfan Liu <piliu@redhat.com>
Cc: kexec@lists.infradead.org
Subject: Re: [PATCH] kexec/zboot: Add boundary check on PE header offset
Date: Wed, 14 May 2025 11:45:22 +0100	[thread overview]
Message-ID: <20250514104522.GG3339421@horms.kernel.org> (raw)
In-Reply-To: <20250513103240.16803-1-piliu@redhat.com>

On Tue, May 13, 2025 at 06:32:40PM +0800, Pingfan Liu wrote:
> If a buildroot enviorment does not provide libzstd and kexec_file_load a
> zstd compressed kernel, it will suffer from coredump.
> 
> The following is observed from the coredump
> 
> Core was generated by `/sbin/kexec -s -p --command-line=BOOT_IMAGE=\(hd0,gpt2\)/vmlinuz-6.15.0-0.rc5.250509g9c69f8884904.47.fc43.aarch64\ ro\ rootflags=subvol=root\ irqpoll\ nr_cpus=1\ reset_devices\ cgroup_disable=memory\ udev.children-max=2\ panic=10\ swiotlb=noforce\ novmcoredd\ cma=0\ hugetlb_cma=0\ sbsa_gwdt.pretimeout=0 --initrd=/boot/initramfs-6.15.0-0.rc5.250509g9c69f8884904.47.fc43.aarch64kdump.img /boot/vmlinuz-6.15.0-0.rc5.250509g9c69f8884904.47.fc43.aarch64'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> 143		if (!!memcmp(buf, "PE\0\0", 4)) {
> (gdb)
> 
> Instead of coredump, it is better to exit elegantly by adding checkout
> on the PE header offset.
> 
> Signed-off-by: Pingfan Liu <piliu@redhat.com>

Thanks, applied.


      reply	other threads:[~2025-05-14 12:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13 10:32 [PATCH] kexec/zboot: Add boundary check on PE header offset Pingfan Liu
2025-05-14 10:45 ` Simon Horman [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=20250514104522.GG3339421@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=kexec@lists.infradead.org \
    --cc=piliu@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.