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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 2943FC76191 for ; Mon, 15 Jul 2019 14:09:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB3FC212F5 for ; Mon, 15 Jul 2019 14:09:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563199783; bh=PLsGesLjtXXM/WMov317wtvkxa6wBD7fcbSpD4dBj9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ztc2yL1cIzLZ/nuD8Zsg7ik4vj1PBATtqV7aZtFjW73/4b4rXegS4r1BFgJBLrXgS CAlW34Cwq1ZYM7BkPOlpVs2VL0uCXK6Dt1Wx+BeRnyGTnMTeTrjXZa8whMxy3FvQ33 bLG7ZTE2pCP9fPQaa4y7CG0ya5+O0LiCHonhR5qM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388238AbfGOOJm (ORCPT ); Mon, 15 Jul 2019 10:09:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:33248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387983AbfGOOJe (ORCPT ); Mon, 15 Jul 2019 10:09:34 -0400 Received: from sasha-vm.mshome.net (unknown [73.61.17.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 09F09212F5; Mon, 15 Jul 2019 14:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563199773; bh=PLsGesLjtXXM/WMov317wtvkxa6wBD7fcbSpD4dBj9g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FuWDUUW4QLhJCcUYEoixP7SxqvieQYuhuQ8xpRCP7XDmrzF3J9JhZA73xW+1Z9SWw TUBThNas5CTjgDUtUiHMpEFGrHx6EMl76jJnlXsQypHdZYGF7NFXD4DOAyNh6F8Off IfbLA4qSNM8vIlJZsDOpgG8dbWVx/RpR4u3ZS2K8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Geert Uytterhoeven , Nayna Jain , James Morris , Mimi Zohar , Sasha Levin , linux-security-module@vger.kernel.org Subject: [PATCH AUTOSEL 5.1 102/219] integrity: Fix __integrity_init_keyring() section mismatch Date: Mon, 15 Jul 2019 10:01:43 -0400 Message-Id: <20190715140341.6443-102-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190715140341.6443-1-sashal@kernel.org> References: <20190715140341.6443-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven [ Upstream commit 8c655784e2cf59cb6140759b8b546d98261d1ad9 ] With gcc-4.6.3: WARNING: vmlinux.o(.text.unlikely+0x24c64): Section mismatch in reference from the function __integrity_init_keyring() to the function .init.text:set_platform_trusted_keys() The function __integrity_init_keyring() references the function __init set_platform_trusted_keys(). This is often because __integrity_init_keyring lacks a __init annotation or the annotation of set_platform_trusted_keys is wrong. Indeed, if the compiler decides not to inline __integrity_init_keyring(), a warning is issued. Fix this by adding the missing __init annotation. Fixes: 9dc92c45177ab70e ("integrity: Define a trusted platform keyring") Signed-off-by: Geert Uytterhoeven Reviewed-by: Nayna Jain Reviewed-by: James Morris Signed-off-by: Mimi Zohar Signed-off-by: Sasha Levin --- security/integrity/digsig.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/security/integrity/digsig.c b/security/integrity/digsig.c index e19c2eb72c51..37869214c243 100644 --- a/security/integrity/digsig.c +++ b/security/integrity/digsig.c @@ -73,8 +73,9 @@ int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen, return -EOPNOTSUPP; } -static int __integrity_init_keyring(const unsigned int id, key_perm_t perm, - struct key_restriction *restriction) +static int __init __integrity_init_keyring(const unsigned int id, + key_perm_t perm, + struct key_restriction *restriction) { const struct cred *cred = current_cred(); int err = 0; -- 2.20.1