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 DD722C7115C for ; Sun, 22 Jun 2025 12:25:17 +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:MIME-Version:Date: Content-Transfer-Encoding:Content-Type:References:In-Reply-To:Cc:To:From: Subject:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cQeOCvEZJftYIWriW4YD8qUFLKSLRcM+bzupOIftamU=; b=VaphyoERyDrUHzPfFSxcvnsrq+ 4IKfj7h4m0U4MhOFGSPN0PiQ8uK2jQ206ehetlqICYZWWCwewDBblPmpCAGqo4Qm/gdDVoFw/jVSV 8riYzaZBJrfcK+NqbTTF1MXlu9SeoQAkZY6Tv7io+j81Z6Sj7zcvInPDIg0WbNRAyLqIuIsPmIvCU VAHL7MSg5B/vWrglomwYG0yU4TOGlLUc8YaAe8OIymHjCQCk+BgOqhlqQKDxliqwz60+X24bwdQr1 nvFcnttQCIIOuBcXENdcoEqEFVeTTrKb/mJluMdq+ER3l8Z99RIDVAZJoM9S9hoPuMZNPTz4yDY3o txclru1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uTJl2-00000000q7h-2jf3; Sun, 22 Jun 2025 12:25:12 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uTJim-00000000pwe-23sx for linux-arm-kernel@lists.infradead.org; Sun, 22 Jun 2025 12:22:53 +0000 Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55M9U1KN001347; Sun, 22 Jun 2025 12:22:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=cQeOCv EZJftYIWriW4YD8qUFLKSLRcM+bzupOIftamU=; b=f469nGfoUK6zRFeCKnECAQ 2frMspi3yUyiZ1iTcVPr4OvtRZOurFwfDsNS5Ve3311/0VzaUpUgrzr8BPVwyCln /prtz51AHRYA5AIfLg6nBRzkwoK4qEOPoyUs9sVK6KVzW1+n+ifbLHzbZ4pKFR7V BJGeuTmn8wEKSAkMTamXkifMXFdFOgSeatR9mUL5fdV4Q0fPHPhkQUqxJ7AuDfGh G2KlBHXJxxpcrQnhbo96fy1BurYcxs9TZ8xP6aEITpvvl9KhxbDR9Ch4cKriYv+v TzPavutV2dkMceF6Zi7W473+9rhXobfvjYYv20AJUa+OUeeWFPAt08iWvh5vjkGA == Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 47dmf2mjy0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 22 Jun 2025 12:22:45 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 55MCMiWn002080; Sun, 22 Jun 2025 12:22:44 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 47dmf2mjxu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 22 Jun 2025 12:22:44 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 55M8HsgC003994; Sun, 22 Jun 2025 12:22:43 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 47e99k9gxe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 22 Jun 2025 12:22:43 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 55MCMhX612321336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 22 Jun 2025 12:22:43 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 354845804B; Sun, 22 Jun 2025 12:22:43 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 33EC258059; Sun, 22 Jun 2025 12:22:42 +0000 (GMT) Received: from li-43857255-d5e6-4659-90f1-fc5cee4750ad.ibm.com (unknown [9.61.92.25]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Sun, 22 Jun 2025 12:22:42 +0000 (GMT) Message-ID: <47dbda783e5919a8137e3781472fe7ae94ee1c73.camel@linux.ibm.com> Subject: Re: [PATCH v4 1/2] firmware: arm_ffa: Change initcall level of ffa_init() to rootfs_initcall From: Mimi Zohar To: Yeoreum Yun , jarkko@kernel.org, sudeep.holla@arm.com, peterhuewe@gmx.de, jgg@ziepe.ca, stuart.yoder@arm.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org In-Reply-To: <20250618102302.2379029-2-yeoreum.yun@arm.com> References: <20250618102302.2379029-1-yeoreum.yun@arm.com> <20250618102302.2379029-2-yeoreum.yun@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Date: Sun, 22 Jun 2025 08:22:41 -0400 MIME-Version: 1.0 User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) X-TM-AS-GCONF: 00 X-Authority-Analysis: v=2.4 cv=M5FNKzws c=1 sm=1 tr=0 ts=6857f595 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=IkcTkHD0fZMA:10 a=6IFa9wvqVegA:10 a=7CQSdrXTAAAA:8 a=VnNF1IyMAAAA:8 a=DDGuNG6xrOoNSW4XS2IA:9 a=QEXdDO2ut3YA:10 a=a-qgeE7W1pNrGK8U0ZQC:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjIyMDA3NiBTYWx0ZWRfX/vOuTE67BXDo idPqzdNkfcnMbLwb4vXYRhxryNp1Y4UPsaXdLQPyV1Qe8LJn471ge+7uBRvx0ZsJ4oy31JZTEfe YyHSwE3RjycjStnfIDWc/sSffqN0KrjOoc5rfCEIMMzVoAYW4hxqMdaCqUIl0nc72IvChl1yyhv gAje4CL5mo1YIur7sHb/KJP/A/BkG13d0wS192cJ3vTUuk9+TGJKKGXaOW9RYC8b8tI9SUqs3c9 SzQ83rNnTZuAwYa0UGlTZrSyME50LN8gU+GC4dTCDQ/xvaBlglJBsKU/nPMbHMkF38VWPmfuy1e yWKZRSQVouhXUVXAujW1VJaNs2Ok8Pot5+KCIhKL24y3u6Y5iJ4gqDkYTPzmHQh+CgdJ0haR/Zk INsoVoXbO/P4lgEW1hKtNa5ukxTSYdfZL6JRZx34ZDavd4XMshuAVLws/i8pWuNcSJd1Y1w7 X-Proofpoint-GUID: VWP3MNWq71S8Z8s0TWtHd95NamqWgdZX X-Proofpoint-ORIG-GUID: OzPov1yOrvGApJkFDG_m7XqcFoHhFzOs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-22_04,2025-06-20_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 impostorscore=0 suspectscore=0 priorityscore=1501 phishscore=0 spamscore=0 clxscore=1011 adultscore=0 mlxscore=0 mlxlogscore=999 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506220076 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250622_052252_649959_9959A7DD X-CRM114-Status: GOOD ( 25.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 2025-06-18 at 11:23 +0100, Yeoreum Yun wrote: > The Linux IMA (Integrity Measurement Architecture) subsystem used for sec= ure > boot, file integrity, or remote attestation cannot be a loadable module > for few reasons listed below: >=20 > o Boot-Time Integrity: IMA=E2=80=99s main role is to measure and apprais= e files > before they are used. This includes measuring critical system files du= ring > early boot (e.g., init, init scripts, login binaries). If IMA were a m= odule, > it would be loaded too late to cover those. >=20 > o TPM Dependency: IMA integrates tightly with the TPM to record measurem= ents > into PCRs. The TPM must be initialized early (ideally before init_ima(= )), > which aligns with IMA being built-in. >=20 > o Security Model: IMA is part of a Trusted Computing Base (TCB). Making = it a > module would weaken the security model, as a potentially compromised s= ystem > could delay or tamper with its initialization. >=20 > IMA must be built-in to ensure it starts measuring from the earliest poss= ible > point in boot which inturn implies TPM must be initialised and ready to u= se > before IMA. >=20 > To enable integration of tpm_event_log with the IMA subsystem, the TPM dr= ivers > (tpm_crb and tpm_crb_ffa) also needs to be built-in. However with FF-A dr= iver > also being initialised at device initcall level, it can lead to an > initialization order issue where: > - crb_acpi_driver_init() may run before tpm_crb_ffa_driver()_init and ff= a_init() > - As a result, probing the TPM device via CRB over FFA is deferred > - ima_init() (called as a late initcall) runs before deferred probe comp= letes, > IMA fails to find the TPM and logs the below error: >=20 > | ima: No TPM chip found, activating TPM-bypass! >=20 > Eventually it fails to generate boot_aggregate with PCR values. >=20 > Because of the above stated dependency, the ffa driver needs to initialis= ed > before tpm_crb_ffa module to ensure IMA finds the TPM successfully when > present. >=20 > Signed-off-by: Yeoreum Yun Thank you for the well written patch description. > --- > drivers/firmware/arm_ffa/driver.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa= /driver.c > index fe55613a8ea9..1a690b8186df 100644 > --- a/drivers/firmware/arm_ffa/driver.c > +++ b/drivers/firmware/arm_ffa/driver.c > @@ -2058,7 +2058,7 @@ static int __init ffa_init(void) > kfree(drv_info); > return ret; > } > -module_init(ffa_init); > +rootfs_initcall(ffa_init); LGTM as the driver is always builtin. Reviewed-by: Mimi Zohar > =20 > static void __exit ffa_exit(void) > {