Message ID | 20230714153435.28155-4-nayna@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp2590452vqm; Fri, 14 Jul 2023 08:45:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlGQPwZUUiBdPKsDcteLEsOWsgQ5nJDzU4pyF28gOjVL6InzPlP1N/Qc1YeAnCAjorh+1+L7 X-Received: by 2002:a92:d986:0:b0:345:b536:61f with SMTP id r6-20020a92d986000000b00345b536061fmr4325372iln.31.1689349504323; Fri, 14 Jul 2023 08:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689349504; cv=none; d=google.com; s=arc-20160816; b=LwsaMawT7VXPSxKpkuVWrjXrMlgfHK1ZnoiJ8m3+UHhN+xIduNCOrTZSeVPRNyqS/P NTqFU0svSdsYwwxG5Cx5VBP9BeqfTOfIVs1lQKMBsCSchztURb2vs+JHZIxXOMW42jN5 I853yMthtp+CEPpezzDLszuveIUS6DdLMAmLP95+pEYw8yZaFwLStEqfBW+vIDmTqWbC zOU7NdcdTcdPBHqnuNSTsaNDSdqq7LuYJ9Nn3YwyQVq8vtRVnZOmWYertQHBkRuGbKDe cFdMaBILdm/BPRCz3FAzyKMVJRgM02TPcK1bXP/3Wxrau/AFygu74/qCjozDSoC7MG2B 3d8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gBZmB9VFj+p+lHN+6p+ctuqQ3BKIbqxNVoPsF4cR2EA=; fh=xUlcC+Arz0lYctjWPpiaPSbbcPpWgnum2V1Myf8/1N8=; b=a3BIViHN0WV7Ju9/pQoRhpakgILx1LOTHacIjIiuahOwQTQFrVbmmETmJf8YWvQRAd alTZkbNsb031dKpwoSA8MxQRBb7vCxkEGmi8EZNi8vEeLzrSiCirN19fetsob0yUHrSB rVfAQW0PXWcCv0IQGB66KL3HKn2Ovu2l67eyGsMULkb+fK47CbmyNSdkwMqlFQPFdBEi EHS9HliA8a/hTayEButW2568k6Vr9Eky8ByUvB+p7QdsReTMp3nxPpgpMF40tPFdv3te Zczy6yUvZeHzzjxdmWZasmmvbfqR3v1HZpJcjyeJfdU/bxLRdpjRJN7diPtGde1vUK4i ZPig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=RbZcWo3Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my5-20020a17090b4c8500b00262ebe643a2si1478292pjb.186.2023.07.14.08.44.51; Fri, 14 Jul 2023 08:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=RbZcWo3Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236410AbjGNPfY (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Fri, 14 Jul 2023 11:35:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236372AbjGNPfC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 14 Jul 2023 11:35:02 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5021030C0; Fri, 14 Jul 2023 08:35:01 -0700 (PDT) Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36EFO325005483; Fri, 14 Jul 2023 15:34:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=gBZmB9VFj+p+lHN+6p+ctuqQ3BKIbqxNVoPsF4cR2EA=; b=RbZcWo3Qq0koh6utTvoNaUcO8+1bi4gHP1OlF9x2rSQ5YVK2ra5Ic0NET1xkMCWuN1IK P4ukMnExlP6A7kP2au064w7GWz3g03F2EnXww8y+Ly07fCMUQkEwzQgELL260SxeoL0x Pkttpr0GgSjFk8WR+RSW0ymeOwNTGyn/J5aqgpYhweDuOgairn1pINlvWUA5kkVQreFf L9cXNAcXLiEzzfQ+XssQoBiHm1j0o1CQ546twrzXKgUKHos83mp/7uhIR31ULnAIlIKV pwQi4Gd3X0qsdIEUMBRpZmwsOCg8TAuFnhztSqygbS1SEqhoQWfyEpaSFxzfQzNF/GtF YA== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ru8ye06cq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jul 2023 15:34:54 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36E851RB031217; Fri, 14 Jul 2023 15:34:52 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3rtpvu1fxg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 14 Jul 2023 15:34:52 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36EFYnor12059136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Jul 2023 15:34:49 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F02D420043; Fri, 14 Jul 2023 15:34:48 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01BBE20040; Fri, 14 Jul 2023 15:34:47 +0000 (GMT) Received: from li-4b5937cc-25c4-11b2-a85c-cea3a66903e4.ibm.com (unknown [9.61.52.39]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 14 Jul 2023 15:34:46 +0000 (GMT) From: Nayna Jain <nayna@linux.ibm.com> To: linux-integrity@vger.kernel.org Cc: Mimi Zohar <zohar@linux.ibm.com>, Jarkko Sakkinen <jarkko@kernel.org>, Eric Snowberg <eric.snowberg@oracle.com>, Paul Moore <paul@paul-moore.com>, linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Nayna Jain <nayna@linux.ibm.com> Subject: [PATCH 3/6] integrity: remove global variable from machine_keyring.c Date: Fri, 14 Jul 2023 11:34:32 -0400 Message-Id: <20230714153435.28155-4-nayna@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230714153435.28155-1-nayna@linux.ibm.com> References: <20230714153435.28155-1-nayna@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: PyBeY9VwSIV3Cgl31GPC5WSb6N2iXmIZ X-Proofpoint-GUID: PyBeY9VwSIV3Cgl31GPC5WSb6N2iXmIZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-14_06,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 priorityscore=1501 suspectscore=0 impostorscore=0 bulkscore=0 mlxscore=0 clxscore=1015 malwarescore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307140141 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771411346037387103 X-GMAIL-MSGID: 1771411346037387103 |
Series |
Enable loading local and third party keys on PowerVM guest
|
|
Commit Message
Nayna Jain
July 14, 2023, 3:34 p.m. UTC
trust_mok variable is accessed within a single function locally.
Change trust_mok from global to local static variable.
Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
---
security/integrity/platform_certs/machine_keyring.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Fri, 2023-07-14 at 11:34 -0400, Nayna Jain wrote: > trust_mok variable is accessed within a single function locally. > > Change trust_mok from global to local static variable. > > Signed-off-by: Nayna Jain <nayna@linux.ibm.com> Reviewed-and-tested-by: Mimi Zohar <zohar@linux.ibm.com>
diff --git a/security/integrity/platform_certs/machine_keyring.c b/security/integrity/platform_certs/machine_keyring.c index 389a6e7c9245..9482e16cb2ca 100644 --- a/security/integrity/platform_certs/machine_keyring.c +++ b/security/integrity/platform_certs/machine_keyring.c @@ -8,8 +8,6 @@ #include <linux/efi.h> #include "../integrity.h" -static bool trust_mok; - static __init int machine_keyring_init(void) { int rc; @@ -65,9 +63,11 @@ static __init bool uefi_check_trust_mok_keys(void) bool __init trust_moklist(void) { static bool initialized; + static bool trust_mok; if (!initialized) { initialized = true; + trust_mok = false; if (uefi_check_trust_mok_keys()) trust_mok = true;