Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3894004ybg; Sun, 7 Jun 2020 14:11:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyhs3ZO32eZlEHYw2slpgpIZzR+FwVLrqnDjBUeQ0m8Iyc8azS/0VPO5+MbQ1eJ3W3Z/zR X-Received: by 2002:a17:906:1dc9:: with SMTP id v9mr18824744ejh.252.1591564270816; Sun, 07 Jun 2020 14:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591564270; cv=none; d=google.com; s=arc-20160816; b=aSNTHZ2TxzWVqfgVl3S2AI3qoRPSt1fG6+DyWDSdEdwLfdKXbTNpzKJbkV0E4bBUoF +MNS+lE9NFRFdN+wJnVUvJwIuMd6wRZa54Ks2Eg9cdKwcnv3oPdNA2JCMLPObrX6GqPb uH89U0eXJldkiW/8c1ceSg/eFjILLQjpbZgDHl4GZEYNoFeW4wyvdlhhQlcDJw0zBYic 3VxaQupYHs5OdWlcMURbVbRSAPOl5kFvYisMxEoLTyaoNCRpEqPhwsuKZRdeCYkBgoYx gTamC4pApuT2wXrJrkQgnYaVpjU+DgS7pYbK75boTPG1qGsvzuqzs6IsSsgolViqeNkN Z9CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=Ipl9bDgmVjer0FHxMhnErLR8lmLqT7d60jJVa3XMzBM=; b=S46Y0kBQO/mOSJcWntaKm1BuBEs207kbzqJxlBuWhqynW7m5j4H+Fop9vx/ppif02W l/xSmF9kFGzCuopW68T4rq3qMWjRdXaHTjq7nS5nimq/rBJJHe52MR2RUD/UyxrqqKIE jLVQIWCKXxuPgNLLHVth9d5hm0nU737h4pBFmXS0Ml5g3BdxpvkJ1MJycnM3w49Xq1nS JD84HOq3mWaElEef0KXDz8TOOGZ5nRPJsl7XDoLj6EoQXt1GXE4fo/5tGG5uhBRmO3eF dJah8qikwi6SPaYERe+uyjEwRGey9i82VNsOJhXU2qttJTE+O37gIa5OaC4FpziFWweS N+Xw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr2si6367870ejc.18.2020.06.07.14.10.15; Sun, 07 Jun 2020 14:11:10 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727800AbgFGVEI (ORCPT + 99 others); Sun, 7 Jun 2020 17:04:08 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2289 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726093AbgFGVEH (ORCPT ); Sun, 7 Jun 2020 17:04:07 -0400 Received: from lhreml726-chm.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 54B20946EDD84EFE634E; Sun, 7 Jun 2020 22:04:05 +0100 (IST) Received: from fraeml714-chm.china.huawei.com (10.206.15.33) by lhreml726-chm.china.huawei.com (10.201.108.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Sun, 7 Jun 2020 22:04:05 +0100 Received: from roberto-HP-EliteDesk-800-G2-DM-65W.huawei.com (10.204.65.160) by fraeml714-chm.china.huawei.com (10.206.15.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1913.5; Sun, 7 Jun 2020 23:04:03 +0200 From: Roberto Sassu To: , CC: , , , Roberto Sassu , Subject: [PATCH] ima: Remove __init annotation from ima_pcrread() Date: Sun, 7 Jun 2020 23:00:29 +0200 Message-ID: <20200607210029.30601-1-roberto.sassu@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.204.65.160] X-ClientProxiedBy: lhreml705-chm.china.huawei.com (10.201.108.54) To fraeml714-chm.china.huawei.com (10.206.15.33) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 6cc7c266e5b4 ("ima: Call ima_calc_boot_aggregate() in ima_eventdigest_init()") added a call to ima_calc_boot_aggregate() so that the digest can be recalculated for the boot_aggregate measurement entry if the 'd' template field has been requested. For the 'd' field, only SHA1 and MD5 digests are accepted. Given that ima_eventdigest_init() does not have the __init annotation, all functions called should not have it. This patch removes __init from ima_pcrread(). Cc: stable@vger.kernel.org Fixes: 6cc7c266e5b4 ("ima: Call ima_calc_boot_aggregate() in ima_eventdigest_init()") Reported-by: Linus Torvalds Signed-off-by: Roberto Sassu --- security/integrity/ima/ima_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c index ba5cc3264240..220b14920c37 100644 --- a/security/integrity/ima/ima_crypto.c +++ b/security/integrity/ima/ima_crypto.c @@ -786,7 +786,7 @@ int ima_calc_buffer_hash(const void *buf, loff_t len, return calc_buffer_shash(buf, len, hash); } -static void __init ima_pcrread(u32 idx, struct tpm_digest *d) +static void ima_pcrread(u32 idx, struct tpm_digest *d) { if (!ima_tpm_chip) return; -- 2.17.1