Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1792437pxk; Tue, 1 Sep 2020 07:57:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybGmxB0VFqaTV+8+d9xfXrAG+zTuYDSl92oTnwX1MyacFOpSu6esOPiaTpWnOE5TyCLXim X-Received: by 2002:a50:d9c1:: with SMTP id x1mr2099986edj.283.1598972274755; Tue, 01 Sep 2020 07:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598972274; cv=none; d=google.com; s=arc-20160816; b=0l40bPSe+OGglTQ992h7pYDcTSAmAemChl1befz2OtdE5UkfhHfHZHimsE1BcpHCza Sqv0tMAAC1CqOWUOeMclJk2ej9Iq70UJg5g9srP4YATlmy5lXCbVn/m39g/G2dUw0Dho /pHISywrqiJ5Rppj3LgQxePiKgQBpllkT9rBL/XZsh+Vh4NtTM7m9iC7WgMVI/rWx3/o 5BSNQ7KrBcPDhODj4WCb5TCOP+Yvj2PcKvMsmNLR/aimBpjzCMmHrNodUo1UAm9129jJ ieuZ6N6XmUSSS3NgWzEQPe3eicLza5Y7o8jwvEl3k/Bui40H3Ur2ItkaoFY6MKqt0XAY DGhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:dkim-signature :dkim-signature:date; bh=pA6QutgyvtCbNdLvfwI+2OFUhlLVjQHsEDvQCshtOxA=; b=GnkWdkUM+Arc3HIDK1hF9xWtClzBtWPoFdQa2J3ETnlbjUBnm92AWx7KSEftJofQEa NDQAEBlnsswUEt7NoJeo2vq/8eFL1jwJ/QNfbfw08Gv9GT3V7oEUel0KuvT4S82uwGC8 EP00d7C1yos0u8JONLEiudhmCYVB8Z8aqo8oNxu6JVqBtdnHA2I4IUSGObdQsReLijHL ZaB5d0ajKqWpUJ9/1X2sVba6FBdIT8TfammBFh4C524uoNBfn3uwJRdHEQQnDK3BKm/c S+AxioEElmnVOc+QSnTixm9XoSow4tQIo3uLAkRv6vLKaTOPkPBLLUr3lQ+t0eT0xZXz yK1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=OExIabFA; dkim=neutral (no key) header.i=@vger.kernel.org; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si783578eju.461.2020.09.01.07.57.31; Tue, 01 Sep 2020 07:57:54 -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; dkim=fail header.i=@linutronix.de header.s=2020 header.b=OExIabFA; dkim=neutral (no key) header.i=@vger.kernel.org; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728114AbgIAOzU (ORCPT + 99 others); Tue, 1 Sep 2020 10:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727800AbgIALs0 (ORCPT ); Tue, 1 Sep 2020 07:48:26 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74244C061245; Tue, 1 Sep 2020 04:47:56 -0700 (PDT) Date: Tue, 01 Sep 2020 11:47:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1598960874; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pA6QutgyvtCbNdLvfwI+2OFUhlLVjQHsEDvQCshtOxA=; b=OExIabFAPit8i5zgrkHIXP1Hg/XVdHblSYBBmAbMe2wdE/rLx6W0NPgvd+wV6y0jlMO+sc j1wf6azBHmq29bSOYiQPEaCUdpLeyWn3XXV5NUrPsLIf+/NGPbSCDAzAUNacF221ldQcYJ h0TyvivEP4Qbqe1EFgrwFQzd/ydSHAinZlkNAH3i5sP8qSVqsh5Fkk+RG/R7rcgGqpC7Bg bUDilUG1NkWfBF/z10xXVXvz/gfuLdrI3BwsEjn6LqDrVXPZO75rjNxYa/SeKfUT9JQV4u ySYG2QVXPqnSaLjoHpjCqncd2SvwD3uu73cvf3OYoDJVOkV1BwlPof2ONQOLdw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1598960874; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pA6QutgyvtCbNdLvfwI+2OFUhlLVjQHsEDvQCshtOxA=; b=Eae08HEFbzPePRzHZi4nkVZp3v1NT5qcdDK7OHcv6GmFXw1MFCwuhRTJDIkQmCAXVfu1Nh zo7kUissMD2kfVBA== From: "tip-bot2 for Kees Cook" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/build] x86/build: Enforce an empty .got.plt section Cc: Kees Cook , Ingo Molnar , x86 , LKML In-Reply-To: <20200821194310.3089815-24-keescook@chromium.org> References: <20200821194310.3089815-24-keescook@chromium.org> MIME-Version: 1.0 Message-ID: <159896087384.20229.7620654432209669942.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the core/build branch of tip: Commit-ID: 815d680771ae09080d2da83dac2647c08cdf99ce Gitweb: https://git.kernel.org/tip/815d680771ae09080d2da83dac2647c08cdf99ce Author: Kees Cook AuthorDate: Fri, 21 Aug 2020 12:43:04 -07:00 Committer: Ingo Molnar CommitterDate: Tue, 01 Sep 2020 10:03:18 +02:00 x86/build: Enforce an empty .got.plt section The .got.plt section should always be zero (or filled only with the linker-generated lazy dispatch entry). Enforce this with an assert and mark the section as INFO. This is more sensitive than just blindly discarding the section. Signed-off-by: Kees Cook Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20200821194310.3089815-24-keescook@chromium.org --- arch/x86/kernel/vmlinux.lds.S | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 0cc035c..4b1b936 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -414,8 +414,20 @@ SECTIONS ELF_DETAILS DISCARDS -} + /* + * Make sure that the .got.plt is either completely empty or it + * contains only the lazy dispatch entries. + */ + .got.plt (INFO) : { *(.got.plt) } + ASSERT(SIZEOF(.got.plt) == 0 || +#ifdef CONFIG_X86_64 + SIZEOF(.got.plt) == 0x18, +#else + SIZEOF(.got.plt) == 0xc, +#endif + "Unexpected GOT/PLT entries detected!") +} #ifdef CONFIG_X86_32 /*