From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A1C1C3ABCC for ; Wed, 14 May 2025 12:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=erVXMnFwjsQ2jmXWc3D0YqDYL6hQiBOwN2U+lti3zJU=; b=AngBkUTi9ZrvoRrmIbF6SwlGNJ 3w8g44RUrIXge64iHWN9OFvBVqMI+61+p6Qgb8UIg576u2XP+bduSii6D4/ysRYvtc/sa6VZJe1Cz HWyTVv9aeD0dowiZKwl77bAtsIgxfWU86+PVY6SgmMPz5AI+DitrF83kXU3/LwHhxeaElLtSrHuSg jf4YMt+Mp47I7lwnxzBeFtGuGfeNzBYiyodtxWYSL6AOr9Lj8kql+xDA/7ZTnY9UkkC0+sFXCZbWJ kPtqCAlu1cNPLsO1NHIdacp+6yYjmlnLmRW1BuwXS4RxMJhQF4n78qVXVUgPNvSPs+WJywqGrl5Le /+/1B39Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uFB67-0000000F47L-3rn2; Wed, 14 May 2025 12:20:31 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uF9c6-0000000EpUo-01o1 for kexec@lists.infradead.org; Wed, 14 May 2025 10:45:26 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 2E61C60008; Wed, 14 May 2025 10:45:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45A3BC4CEF0; Wed, 14 May 2025 10:45:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747219524; bh=8bL96RrNFmyLanCWTNQHfnkyL7MbumWQHL0nVPBezIQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LgXLa335uY57HRxj87xNzCDyCuNvSCpbSgtt0XoAPkLJO+ImeV0Rc8cyF9DmP/hRA Og7OuCrbxnA8WjuTb01tnFrYrSeJq3kZyuaO26p4j1MwPs6dmUJq/hi8kanZjk3SMV k9geMfAagf7LWpYTCCDrIoqiFKbui1ZpTxh/AEd/4Qn6/mCBMyXFev3N+w94klzB/l S+wV0qe7hRTI0jBhT+SddHN1u6R6o3bizYnsakfC62pyR18/XDP+oJrvkcfOcvtCG/ PFIlAkpsrmVv2XINwPFRSfFz3LaHIJinDkOI3rtiITHxs8gBnKTQ/j1iwSIiRkAO3z +zg5u6+6AraTw== Date: Wed, 14 May 2025 11:45:22 +0100 From: Simon Horman To: Pingfan Liu Cc: kexec@lists.infradead.org Subject: Re: [PATCH] kexec/zboot: Add boundary check on PE header offset Message-ID: <20250514104522.GG3339421@horms.kernel.org> References: <20250513103240.16803-1-piliu@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250513103240.16803-1-piliu@redhat.com> X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org 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 Thanks, applied.