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 X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAE3DC2D0A3 for ; Tue, 3 Nov 2020 18:50:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6BE222074B for ; Tue, 3 Nov 2020 18:50:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oR2mzP8J"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Oogk72Up" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BE222074B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Mime-Version:References:In-Reply-To:Date: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=WrmjFUNr5LbAxlnBpv4ghOmVywk9WZpnO4z591WuMPA=; b=oR2mzP8Jpw4HJ73e3tmlzR/CP LcYVYSV2g8X8jTmkloJzoSnb1wrEng/yNo0drOHZWKCLbOn4OHOeP4+NNbA34llCaunKj3wG74se0 Sx7FVVd+zP9SpMPK+npNPjs0aFTprX+GRo6quG86e39KkpGcv9RjYhN5/GjXRzGwKDbK9I2w5lycj QNsejgPndnnEd9npyH18Y0YOCI1er+WxXgDhzMF9nq/IvqUIXfe7z+4WKKasV3F6t/9q4CAG9KHls g4Pz2IQ4T4TX0Hn2qL2JjvJMDr9VkY5Z1LS6uoCvio4LCR7Zs3OV+FsnDksfWfmSOZVZnzYlKaWq5 4YnAiP4sw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ka1Mv-00025R-Ri; Tue, 03 Nov 2020 18:49:21 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ka1Mp-00023N-GT for linux-arm-kernel@lists.infradead.org; Tue, 03 Nov 2020 18:49:18 +0000 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A3IVInp076108; Tue, 3 Nov 2020 13:49:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=XbU6z4LdrYfUhGMmjonRce3KkZEv6u0ng4kVFEKxkqg=; b=Oogk72Up/WJecFnZF65tJk6ABaa75uNw1rpMZrP4SLkQJnuMQ7eTwCR/tZGvLR0bR5lW nDRiCWjcnCMEBoawWD4CV2mYERs6P3xvkuRRljAcxDTV5NyZca7idApOatqaYEmPoxkd lKemYUoKnPVnFT/+Ovu7CgSz4V5aqQw9XODfDXtYfkQxRzUREsVt5jG+qeJYoJmuAfNa x1Wef4dqptLs9N1udtBBiCzbrdgOjfvWt+2BcSWseD46k1R2I7akfTV9dVQXxSWBCaZ2 XdOZTGg0OyyRuZNnVw3ZgUVjwz+N6h/2F0mq6dINonBIicKDg2FoOBeongYELmlvs3GC ZA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 34jwj1nts6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Nov 2020 13:49:06 -0500 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0A3IepPM127117; Tue, 3 Nov 2020 13:49:06 -0500 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com with ESMTP id 34jwj1ntr3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Nov 2020 13:49:05 -0500 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0A3Il7DA008820; Tue, 3 Nov 2020 18:49:03 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma02fra.de.ibm.com with ESMTP id 34j6j41222-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Nov 2020 18:49:03 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0A3In1du19792288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 3 Nov 2020 18:49:01 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1C5B742049; Tue, 3 Nov 2020 18:49:01 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5845542041; Tue, 3 Nov 2020 18:48:58 +0000 (GMT) Received: from sig-9-65-255-16.ibm.com (unknown [9.65.255.16]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 3 Nov 2020 18:48:58 +0000 (GMT) Message-ID: <93e614b138c9f047612db304ca5ebe8a7b21c941.camel@linux.ibm.com> Subject: Re: [PATCH v4 1/3] efi: generalize efi_get_secureboot From: Mimi Zohar To: Ard Biesheuvel , linux-efi@vger.kernel.org Date: Tue, 03 Nov 2020 13:48:56 -0500 In-Reply-To: <20201102223800.12181-2-ardb@kernel.org> References: <20201102223800.12181-1-ardb@kernel.org> <20201102223800.12181-2-ardb@kernel.org> X-Mailer: Evolution 3.28.5 (3.28.5-12.el8) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-03_08:2020-11-03, 2020-11-03 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=3 adultscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 impostorscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011030123 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201103_134915_921323_0907684F X-CRM114-Status: GOOD ( 23.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jlee@suse.com, dmitry.kasatkin@gmail.com, x86@kernel.org, jmorris@namei.org, clin@suse.com, catalin.marinas@arm.com, linux-integrity@vger.kernel.org, will@kernel.org, linux-arm-kernel@lists.infradead.org, serge@hallyn.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 2020-11-02 at 23:37 +0100, Ard Biesheuvel wrote: > From: Chester Lin > > Generalize the efi_get_secureboot() function so not only efistub but also > other subsystems can use it. > > Note that the MokSbState handling is not factored out: the variable is > boot time only, and so it cannot be parameterized as easily. Also, the > IMA code will switch to this version in a future patch, and it does not > incorporate the MokSbState exception in the first place. > > Note that the new efi_get_secureboot_mode() helper treats any failures > to read SetupMode as setup mode being disabled. > > Co-developed-by: Chester Lin > Signed-off-by: Chester Lin > Signed-off-by: Ard Biesheuvel Thanks, Ard. Other than one minor thing inline below, the patch looks good. I haven't done any testing yet. > diff --git a/include/linux/efi.h b/include/linux/efi.h > index bd9d83a94173..79b2d4de62e0 100644 > --- a/include/linux/efi.h > +++ b/include/linux/efi.h > @@ -1082,7 +1082,28 @@ enum efi_secureboot_mode { > efi_secureboot_mode_disabled, > efi_secureboot_mode_enabled, > }; > -enum efi_secureboot_mode efi_get_secureboot(void); > + > +static inline > +enum efi_secureboot_mode efi_get_secureboot_mode(efi_get_variable_t *get_var) get_var() should be defined as "efi_status_t". If this is being upstreamed via integrity, I can make the change. thanks, Mimi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel