From patchwork Thu Feb 4 15:50:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 61202 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp535951lbl; Thu, 4 Feb 2016 07:52:14 -0800 (PST) X-Received: by 10.66.229.104 with SMTP id sp8mr11865587pac.53.1454601133992; Thu, 04 Feb 2016 07:52:13 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 2si17466321pfm.127.2016.02.04.07.52.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Feb 2016 07:52:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRMBe-0004WU-FX; Thu, 04 Feb 2016 15:51:14 +0000 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aRMBT-0004Jk-Tg for linux-arm-kernel@lists.infradead.org; Thu, 04 Feb 2016 15:51:06 +0000 Received: by mail-wm0-x22c.google.com with SMTP id g62so10718412wme.0 for ; Thu, 04 Feb 2016 07:50:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZLgxAVNW1Eiw5NkFWuN/I9bEFVXJrJwhMG7Eb/Kq2Ek=; b=KnuXH0zD0gEi3NqaOGohK+Hyj3lmwglLObUGY7IJzFAXrDXs4++x+VmFcqlUE6zzKD 2qJTQwxcCDldW1o5UNTmDCK1YAXk89Z1949s+mEoC31QA/mg3gVr3+OCtdTE8VxI3xsI YQLht5ITOYlpW7xYwAIsPOBc6JcpxQbvPV2Wc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZLgxAVNW1Eiw5NkFWuN/I9bEFVXJrJwhMG7Eb/Kq2Ek=; b=THhy03jKIY0gIpTKGJ36KGyIOVoz+dy8SO0Mf69tNlttp/YHFBpnoZqqhomdm/rR1z a8okRI0VAgOXbVBqaB6EUJoPDK2oDkfC1t77oX9/VKDn7/QOlDsTHwlKwTek+Wkweob1 wjpe1RQ3o1IxuWQPfG4tzibsA2iJ5f+ASqBctmFWPNCAaQQEgpVtKzETF/LgiocIGUKk Vxib8NYZVPMpqht8gZ/OL9f2MLBO3Cro6tQPSOWLhB+PEHb9/r7OKGjJV2Wjk3dWMB1p qBNsdevw6UrK/MO+luTutW9aFtxASwlkCpMstxLfXaDsEIJiuKK4Da4bQZpECt+1LeAr Fogw== X-Gm-Message-State: AG10YOQ/p8vS05TBABygJPFmM0+NhU1XKRAx37+NIGWTw/PcckfIhycZmvNWe3fEDetzoloH X-Received: by 10.28.183.9 with SMTP id h9mr31828441wmf.29.1454601042349; Thu, 04 Feb 2016 07:50:42 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id q73sm26885838wmb.1.2016.02.04.07.50.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Feb 2016 07:50:41 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, matt@codeblueprint.co.uk, catalin.marinas@arm.com Subject: [PATCH v2 3/7] efi: efistub: prevent __init annotations from being used Date: Thu, 4 Feb 2016 16:50:26 +0100 Message-Id: <1454601030-9093-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454601030-9093-1-git-send-email-ard.biesheuvel@linaro.org> References: <1454601030-9093-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160204_075104_363582_273231C3 X-CRM114-Status: GOOD ( 11.05 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, Ard Biesheuvel , will.deacon@arm.com, jeremy.linton@arm.com, suzuki.poulose@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org __init annotations should not be used in the EFI stub, since the code is either included in the decompressor (x86, ARM) where they have no effect, or the whole stub is __init annotated at the section level (arm64), by renaming the sections, in which case the __init annotations will be redundant, and will result in section names like .init.init.text, and our linker script does not expect that. So un-#define __init so that its inadvertent use will force a build error. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/efistub.h | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h index 6b6548fda089..275f395c886d 100644 --- a/drivers/firmware/efi/libstub/efistub.h +++ b/drivers/firmware/efi/libstub/efistub.h @@ -5,6 +5,16 @@ /* error code which can't be mistaken for valid address */ #define EFI_ERROR (~0UL) +/* + * __init annotations should not be used in the EFI stub, since the code is + * either included in the decompressor (x86, ARM) where they have no effect, + * or the whole stub is __init annotated at the section level (arm64), by + * renaming the sections, in which case the __init annotation will be + * redundant, and will result in section names like .init.init.text, and our + * linker script does not expect that. + */ +#undef __init + void efi_char16_printk(efi_system_table_t *, efi_char16_t *); efi_status_t efi_open_volume(efi_system_table_t *sys_table_arg, void *__image,