From patchwork Sat Mar 4 04:19:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Wei W" X-Patchwork-Id: 64156 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp778614wrd; Fri, 3 Mar 2023 21:13:30 -0800 (PST) X-Google-Smtp-Source: AK7set+K3N2GB0aLKCM6jAlR4DqcCcwZfQI7unztxic5BA384ew5pmcSXGIzN/K7C1N/ko36+by7 X-Received: by 2002:aa7:cf03:0:b0:4c0:8bd8:b4d2 with SMTP id a3-20020aa7cf03000000b004c08bd8b4d2mr4109186edy.42.1677906810421; Fri, 03 Mar 2023 21:13:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677906810; cv=none; d=google.com; s=arc-20160816; b=GtMdHTi35IlrsrIrW01tl7/GLxlwB8uK0ZQICzXP+5t6Gu9ccJDjhpDeupos45ypYL OVgXs4ii1pGZtsNLwjWGuw5aQOpWbopMdb0oDKVx7fvjyay75S2kTWWcbxznLHXoN7KX bqe4Pdvm1mIR0rirpnzD8IAobw5316CG9AZCFFCdkh728nTDAxTeH5+vAVYd1HQ3AbDn TPofFkLZ4ssJwDWqiLWb+jKtv9EJSjsY5G6bQvP1RhHIyEJWdcbfjOQYRailIhrdpihf 98Dns7MBNQrId/dYGTPtxywhIW3SuAGwsvh1YHxvP1/5ZUvYhPTt7ykWOyAWl5LW1T1G cEfw== 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=Vivs7/1T3zc8MKnKuUo0J0oEoV998CT2dg0xmqwGI8U=; b=OfqBlkr+DXVL28A7xUfSaFRuXCFH2EIFHv0lUlYjk7Y8mHcuy9svZ8xBtdF2vm1z4I KJxpDxiAtp5nvuqd8AJWWjS1aZIQcOJcJZFltZ3vujTRVkktvD7uNUimWx3KMCb9w8id D5FeResnbZc+p66EOyIyyd7WyLy9D2bbnvnGXmX61LccsGYCTmcZiVorg0ZoHVDOXJma ANNpgInSiTp7POJ8fOczLmDnhXyj81eoFZYQxGIUbSmq6Qi2buS4Jd9RQY6OP/MbPqov rNKS2Nhb9JLu45vZW0ticzAEmeF6ISbtBiHcztMValQfdsPIbnj864Ex97P9JXDBAciw 2Xzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=engCTQj2; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d25-20020a056402079900b004ab4c6f9996si869451edy.516.2023.03.03.21.13.06; Fri, 03 Mar 2023 21:13:30 -0800 (PST) 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=@intel.com header.s=Intel header.b=engCTQj2; 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229718AbjCDETu (ORCPT + 99 others); Fri, 3 Mar 2023 23:19:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229565AbjCDETn (ORCPT ); Fri, 3 Mar 2023 23:19:43 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 407E71259B for ; Fri, 3 Mar 2023 20:19:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677903582; x=1709439582; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xvEmsWuughcRdW3oGFQ5VdryPdej8zL62swUuDZTanw=; b=engCTQj2R9x0Q22X8Vgse2w7zPaAFGK2vfXALHnSLwgLJRutPMfrPfkO MR4UEl0rhBpwuxtj8I19f7oLs6DE1vwcQtS1gUjBEvzhQy91xFAlUBjvu EInGUSW4ZJxF94qUfvtTEgCsVYfFx3DpqV78eJbYMy9Hlq5vcblDgwWwV SGnMeE+thTk1Ny+tBm/dPLA9/wUComKln+i5sy82h70vByMyfzD3FjfCs clNtAkA6pK4Qyq8VkSzI+FKM2raR54wG9OgKrBXxaVIx/nVqJJZ6xNa5V Gl4n9l1z+HabPR2lIgQ8IzA4lJF0g7tdCI0ZYfa8Nb+CSIOMrWVjWCVQW w==; X-IronPort-AV: E=McAfee;i="6500,9779,10638"; a="315618085" X-IronPort-AV: E=Sophos;i="5.98,232,1673942400"; d="scan'208";a="315618085" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2023 20:19:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10638"; a="708062006" X-IronPort-AV: E=Sophos;i="5.98,232,1673942400"; d="scan'208";a="708062006" Received: from tdx-lm.sh.intel.com ([10.239.53.27]) by orsmga001.jf.intel.com with ESMTP; 03 Mar 2023 20:19:37 -0800 From: Wei Wang To: arnd@arndb.de, akpm@linux-foundation.org, keescook@chromium.org, herbert@gondor.apana.org.au, josh@joshtriplett.org, jani.nikula@intel.com, corbet@lwn.net, jgg@mellanox.com, dmatlack@google.com, mizhang@google.com, pbonzini@redhat.com, seanjc@google.com Cc: linux-kernel@vger.kernel.org, Wei Wang , James.Bottomley@HansenPartnership.com, jarkko@kernel.org Subject: [PATCH v1 1/3] security: keys: don't use data type as variable name Date: Sat, 4 Mar 2023 12:19:30 +0800 Message-Id: <20230304041932.847133-2-wei.w.wang@intel.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230304041932.847133-1-wei.w.wang@intel.com> References: <20230304041932.847133-1-wei.w.wang@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759412811917287380?= X-GMAIL-MSGID: =?utf-8?q?1759412811917287380?= 'bool' is a specific name for the data type that is an alias for the C99 _Bool type. It shoudn't be used as variable names as that causes too much confusion either for the reader or the compilier. CC: James.Bottomley@HansenPartnership.com CC: jarkko@kernel.org Fixes: f2219745250f ("security: keys: trusted: use ASN.1 TPM2 key format for the blobs") Signed-off-by: Wei Wang Reviewed-by: Jarkko Sakkinen --- security/keys/trusted-keys/trusted_tpm2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/security/keys/trusted-keys/trusted_tpm2.c b/security/keys/trusted-keys/trusted_tpm2.c index 2b2c8eb258d5..390d7314f5a6 100644 --- a/security/keys/trusted-keys/trusted_tpm2.c +++ b/security/keys/trusted-keys/trusted_tpm2.c @@ -54,12 +54,13 @@ static int tpm2_key_encode(struct trusted_key_payload *payload, asn1_oid_len(tpm2key_oid)); if (options->blobauth_len == 0) { - unsigned char bool[3], *w = bool; + unsigned char bool_val[3], *w = bool_val; /* tag 0 is emptyAuth */ w = asn1_encode_boolean(w, w + sizeof(bool), true); if (WARN(IS_ERR(w), "BUG: Boolean failed to encode")) return PTR_ERR(w); - work = asn1_encode_tag(work, end_work, 0, bool, w - bool); + work = asn1_encode_tag(work, end_work, 0, + bool_val, w - bool_val); } /*