Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5516978pxu; Tue, 22 Dec 2020 21:03:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHqS0ENhP1+OWJFL0Cnd04+ywDtlvso9fFOlSRI0DWc4YSrGAZ77WLtIvXVv6w939GuJ0H X-Received: by 2002:a17:906:8354:: with SMTP id b20mr22582039ejy.397.1608699800584; Tue, 22 Dec 2020 21:03:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608699800; cv=none; d=google.com; s=arc-20160816; b=mHdQ0EkGZ4rQYUtGmGU6LaV8Tqgs/5EAdnwxThhZTjTvcgNDPjdtjTvain/r0zMHgq nSIKi4el4wu2qJH7tN01EXg38XZkYKlSfheBrikigi0Lzde9ifXT4waaQ7rWFlFhQT1y k39UQfRiemO71oV8ClkeZdMJjCbVp1qald0/K4sgz/sTXVFL5rz98vJ3VFgnNRW2QvVo CXHL8PAd4YhhbHn6B0DpbPSDmgPaGme0xw93xsHdVnyoS5mRoF3nq3WKUN2sTITdq0kO rPaIDFSZsjuMD/EvdiMoKW1/bZmBDMB4tDE5/cRcCnnoja2BWa7D24mw3gm1A1VEXL0X pJjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-filter; bh=jvhh/Z2/WSlyeBqb+UrNARECAlTWvMC3tRARFOQqgQk=; b=gBUtEn4jhYPmmnXTz/mo3WfPt4dK2gvlLJKCSsg9mAz8gweqnRy+OmBdlXyu3djhLG OZspSaeiFg0zKx/3HVDMOVCdk7w92E4EbIeFLcq0ffIKWQdlyrRgr2q8WKEcadkebU+p 8VatwYeqTU8nuDX6rz4/grAsdjNr0o2ePfDAfqvzswPbbAj4XkMj98Kc9qp0nvbKTDrD r99b8k5MGiSCI6SAwtUEmpe5fy63bBuejvwQgHqG/sNoCHSFeth++2UofkuvhUm0PBVp mrpRqxgBlvfUlXmRTAZ6GTSH2FsmbfAdTFQSwVTCGXgJN02AntpDBN2oxHmUGbDl2Qik 9OEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="dD8+/9Cs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si9745370ejc.524.2020.12.22.21.02.57; Tue, 22 Dec 2020 21:03:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b="dD8+/9Cs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726014AbgLWFCf (ORCPT + 99 others); Wed, 23 Dec 2020 00:02:35 -0500 Received: from linux.microsoft.com ([13.77.154.182]:33708 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725270AbgLWFCe (ORCPT ); Wed, 23 Dec 2020 00:02:34 -0500 Received: from [192.168.0.104] (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id 08A6C20B7192; Tue, 22 Dec 2020 21:01:53 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 08A6C20B7192 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1608699713; bh=jvhh/Z2/WSlyeBqb+UrNARECAlTWvMC3tRARFOQqgQk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=dD8+/9CsGqR4mNrHeZSfZKjwbN22nfNq9P1nYds8tsd2JGh5KTdKuI5R2Nlo/jIh/ OfeRlveugjpKV1wIoEBxhhSSIDVC6iV18AABbDlj+rVC5enFFHGtRoUiH90ZzZyoiU 5htWpiqbVtinOGKHLmej7EBQqqW1FD/LHkQ20NeE= Subject: Re: [PATCH v13 2/6] powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c To: Thiago Jung Bauermann Cc: zohar@linux.ibm.com, robh@kernel.org, takahiro.akashi@linaro.org, gregkh@linuxfoundation.org, will@kernel.org, catalin.marinas@arm.com, mpe@ellerman.id.au, james.morse@arm.com, sashal@kernel.org, benh@kernel.crashing.org, paulus@samba.org, frowand.list@gmail.com, vincenzo.frascino@arm.com, mark.rutland@arm.com, dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com, pasha.tatashin@soleen.com, allison@lohutok.net, masahiroy@kernel.org, bhsharma@redhat.com, mbrugger@suse.com, hsinyi@chromium.org, tao.li@vivo.com, christophe.leroy@c-s.fr, prsriva@linux.microsoft.com, balajib@linux.microsoft.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org References: <20201219175713.18888-1-nramas@linux.microsoft.com> <20201219175713.18888-3-nramas@linux.microsoft.com> <87blell6g2.fsf@manicouagan.localdomain> From: Lakshmi Ramasubramanian Message-ID: <6d7e0147-b5e4-d364-af7d-c089217e3fb0@linux.microsoft.com> Date: Tue, 22 Dec 2020 21:01:52 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87blell6g2.fsf@manicouagan.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/22/20 4:19 PM, Thiago Jung Bauermann wrote: > > Lakshmi Ramasubramanian writes: > >> The functions defined in "arch/powerpc/kexec/ima.c" handle setting up >> and freeing the resources required to carry over the IMA measurement >> list from the current kernel to the next kernel across kexec system call. >> These functions do not have architecture specific code, but are >> currently limited to powerpc. >> >> Move setup_ima_buffer() call into of_kexec_setup_new_fdt() defined in >> "drivers/of/kexec.c". >> >> Move the remaining architecture independent functions from >> "arch/powerpc/kexec/ima.c" to "drivers/of/kexec.c". >> Delete "arch/powerpc/kexec/ima.c" and "arch/powerpc/include/asm/ima.h". >> Remove references to the deleted files in powerpc and in ima. >> >> Co-developed-by: Prakhar Srivastava >> Signed-off-by: Prakhar Srivastava >> Signed-off-by: Lakshmi Ramasubramanian >> --- >> arch/powerpc/include/asm/ima.h | 27 ---- >> arch/powerpc/kexec/Makefile | 7 - >> arch/powerpc/kexec/file_load.c | 7 - >> arch/powerpc/kexec/ima.c | 202 ------------------------- >> drivers/of/kexec.c | 235 +++++++++++++++++++++++++++++ >> include/linux/of.h | 2 + >> security/integrity/ima/ima.h | 4 - >> security/integrity/ima/ima_kexec.c | 1 + >> 8 files changed, 238 insertions(+), 247 deletions(-) >> delete mode 100644 arch/powerpc/include/asm/ima.h >> delete mode 100644 arch/powerpc/kexec/ima.c > > This looks good, provided the changes from the discussion with Mimi are > made. Also, minor nits below. I will address the changes Mimi had stated. > >> diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h >> index 6ebefec616e4..7c3947ad3773 100644 >> --- a/security/integrity/ima/ima.h >> +++ b/security/integrity/ima/ima.h >> @@ -24,10 +24,6 @@ >> >> #include "../integrity.h" >> >> -#ifdef CONFIG_HAVE_IMA_KEXEC >> -#include >> -#endif >> - >> enum ima_show_type { IMA_SHOW_BINARY, IMA_SHOW_BINARY_NO_FIELD_LEN, >> IMA_SHOW_BINARY_OLD_STRING_FMT, IMA_SHOW_ASCII }; >> enum tpm_pcrs { TPM_PCR0 = 0, TPM_PCR8 = 8, TPM_PCR10 = 10 }; > > This belongs in patch 1. No - the reference to "asm/ima.h" cannot be removed in Patch #1 since ima_get_kexec_buffer() and ima_free_kexec_buffer() are still declared in this header. They are moved in this patch only (Patch #2). >> diff --git a/security/integrity/ima/ima_kexec.c b/security/integrity/ima/ima_kexec.c >> index 38bcd7543e27..8a6712981dee 100644 >> --- a/security/integrity/ima/ima_kexec.c >> +++ b/security/integrity/ima/ima_kexec.c >> @@ -10,6 +10,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include "ima.h" > > This include isn't necessary. This change is necessary because ima_get_kexec_buffer() and ima_free_kexec_buffer() are now declared in "linux/of.h". -lakshmi