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 3CEF7C369D5 for ; Thu, 24 Apr 2025 16:07:03 +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=bYUUd0z6A0+ZkWdTi7S3yGhP4LTb46IOeiMEmdUvozc=; b=utNt5Ol1HBK7ASWrWFB56xApMb bCquIwypPKjj8Qip78fX6fZbtHnYQFkqfRck2N6rqHpLpnzIs9R07Y0cERbk/R3ReD+JbyP5OYnH/ FlJeN7ZsOAfIH0gvY2Tg0R7LhqzAphNRltDsVrIdOhGbjpVBCeSbu3Msl56BZv7Sf2jl4//qfm+Vr x/qlNj8zLo0jKFOqHONYlhisH9NE/qALZMt5Bvs5ZqCWjHnQtfSRY+l0hhy0vaoMyGvPLFjsoNSvI GCFI6T6xZ33n7xNAWwMJPpKEMpGVjtbSNf42F/Ab72qNwApBFDDYMzgpE9WrcqrcNIYUi4rAAi39D JriPvmfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u7z6M-0000000Eep6-2xh1; Thu, 24 Apr 2025 16:07:02 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u7xhh-0000000EPTA-49H0 for kexec@lists.infradead.org; Thu, 24 Apr 2025 14:37:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1745505448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bYUUd0z6A0+ZkWdTi7S3yGhP4LTb46IOeiMEmdUvozc=; b=Tj+84V+iufvCAVMRunVjqZvsbgO0myxZwQF3b4IfwZgHtxq872B9SNPWCD9p5KaDo0HNQ4 Ce5qQDmPaKXZpdiH4SlFL87FUwpmbgEr3en08pFiixDQGgJqDzGVpKHwBPrM1spkjalvWb z/0GBYB66Sd7hezgNjIDPltrv5VL0ZY= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-145-pZpKcBiLNymKpzeyzdU94w-1; Thu, 24 Apr 2025 10:37:26 -0400 X-MC-Unique: pZpKcBiLNymKpzeyzdU94w-1 X-Mimecast-MFC-AGG-ID: pZpKcBiLNymKpzeyzdU94w_1745505444 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2090718004A7; Thu, 24 Apr 2025 14:37:23 +0000 (UTC) Received: from localhost (unknown [10.72.112.62]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CAFAC18002AD; Thu, 24 Apr 2025 14:37:20 +0000 (UTC) Date: Thu, 24 Apr 2025 22:37:16 +0800 From: Baoquan He To: steven chen Cc: zohar@linux.ibm.com, stefanb@linux.ibm.com, roberto.sassu@huaweicloud.com, roberto.sassu@huawei.com, eric.snowberg@oracle.com, ebiederm@xmission.com, paul@paul-moore.com, code@tyhicks.com, bauermann@kolabnow.com, linux-integrity@vger.kernel.org, kexec@lists.infradead.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, madvenka@linux.microsoft.com, nramas@linux.microsoft.com, James.Bottomley@hansenpartnership.com, vgoyal@redhat.com, dyoung@redhat.com Subject: Re: [PATCH v13 0/9] ima: kexec: measure events between kexec load and execute Message-ID: References: <20250421222516.9830-1-chenste@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250421222516.9830-1-chenste@linux.microsoft.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250424_073730_102953_FA66ECB2 X-CRM114-Status: GOOD ( 11.05 ) 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 Hi Steven, Could you test below code and post a formal patch to not copy measurement list buffer to kdump kernel? Below log is just for your reference, please feel free to modify or rephrase. === Kdump kernel doesn't need IMA to do integrity measurement. Hence the measurement list in 1st kernel doesn't need to be copied to kdump kenrel. Here skip allocating buffer for measurement list copying if loading kdump kernel. Then there won't be the later handling related to ima_kexec_buffer. === diff --git a/security/integrity/ima/ima_kexec.c b/security/integrity/ima/ima_kexec.c index 38cb2500f4c3..7362f68f2d8b 100644 --- a/security/integrity/ima/ima_kexec.c +++ b/security/integrity/ima/ima_kexec.c @@ -146,6 +146,9 @@ void ima_add_kexec_buffer(struct kimage *image) void *kexec_buffer = NULL; int ret; + if (image->type == KEXEC_TYPE_CRASH) + return; + /* * Reserve extra memory for measurements added during kexec. */