Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp224020ybm; Thu, 28 May 2020 00:51:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyp/+JtoTqHoBor1J0cKUrSvwQcea9gDJUc2PP9wUSYiCVoFW2vHCQf4NGL5p+gnrCoUQ5 X-Received: by 2002:a17:906:a8d:: with SMTP id y13mr1742749ejf.455.1590652282918; Thu, 28 May 2020 00:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590652282; cv=none; d=google.com; s=arc-20160816; b=Nitnf8RiwtvrTKJ1Fzvemzmaj/Hr547PI1817FUYJ2FBzj+/aX/VpVqNy1oUR2fVFx ZW9jH+SSubISPxWTNiB0z9OgyVlic6O2lGMt9EikUqIPtI0uKv/5wERb1Bl6WI0qVKLi +HQ9UCdCFno7Fb8xjoMrhqt/5aB2KeTu10UtniPwAQol0dcw8eK5Wkx7NQIhuRK/SyGg gWUvhuPwAjEL60dhDvDh4DY/TZAHcs3yvA1IKHPRiyWlV5sAwyYzaeHkTS7AcRdQpBR3 1Hd52BVpkQJykEI7qzaXezkTN24HHJDOjux9pCHNLTobd/1OGwJf7zmyR5KRWgwtQZwu y42g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EgG8CoBG+5gnvk6uxuljre7DJhJ5+sFmheD+5jyqV1c=; b=TsDrDNM6ntCMgOINMfIJ+gKnEAJ8tcg+f7LaCNumdAIBU7PDaEWn5aQ7srb+Zsyw3D HzeLJPnMvkttGDPMnep9xjWZnN+PAdqWQeKRYPrU1Kipq6TrtGTV6OVDTEVxrW68qroy 0dn6ESYiNhVo0IlDNWOActVm7BPjcPSkYBTnje2YX3WZYTULmyykNx7JCvsRX7Fgwhab HmEs7h1dm7YwYggitx8qpZs2qLM/0ITKJBxzCrVFNJfYlIVFIaLRLi7R3yA8h0GruzXc veOvgGIaUnGa44MlC7/R53AtUXtndbCiINeyJoTr3IvfFOfJLk1KAZaX1SjA3CJQGTcM Zsrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gfLwNjhu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si3080915edq.115.2020.05.28.00.50.58; Thu, 28 May 2020 00:51:22 -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=pass header.i=@kernel.org header.s=default header.b=gfLwNjhu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726354AbgE1HrD (ORCPT + 99 others); Thu, 28 May 2020 03:47:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:37882 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbgE1HrD (ORCPT ); Thu, 28 May 2020 03:47:03 -0400 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (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 0C03D2145D; Thu, 28 May 2020 07:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590652023; bh=VJkwPm3qnRlzFdRds5A0deQrmmDvdRLKoqaaK4egYLQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gfLwNjhuofZjRW5m8CqEE20xx3xpXmG+bd6cU0vyyR38ciNRRH/tAKKbXx73loEH3 sxi9o4bGk325Gj5ZkSeeeSyUTON18MAUdjTBTiAQdqWCqxf66YNJnmw7LfKh/QbTui yxOYWaWJS11TKKUE0Br8Q4KA8onHEjcQ4bWPWq3U= Received: by mail-il1-f169.google.com with SMTP id c20so26722062ilk.6; Thu, 28 May 2020 00:47:03 -0700 (PDT) X-Gm-Message-State: AOAM533O7dJEWqLtrw4tFPOHJUQd9kn9VAHnMexqcTAvC8c9qCpnp+Uv 29BqIsplQP8thoM9rLkIpJOtU14CNUz11UmGGVY= X-Received: by 2002:a92:3556:: with SMTP id c83mr1578969ila.218.1590652022432; Thu, 28 May 2020 00:47:02 -0700 (PDT) MIME-Version: 1.0 References: <20200523120021.34996-1-ardb@kernel.org> <20200523120021.34996-3-ardb@kernel.org> <20200527143650.GA3103408@rani.riverdale.lan> In-Reply-To: <20200527143650.GA3103408@rani.riverdale.lan> From: Ard Biesheuvel Date: Thu, 28 May 2020 09:46:51 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/3] x86/boot/compressed: force hidden visibility for all symbol references To: Arvind Sankar Cc: linux-efi , X86 ML , Linux Kernel Mailing List , Maarten Lankhorst , Linus Torvalds Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 27 May 2020 at 16:36, Arvind Sankar wrote: > > On Sat, May 23, 2020 at 02:00:20PM +0200, Ard Biesheuvel wrote: > > Eliminate all GOT entries in the decompressor binary, by forcing hidden > > visibility for all symbol references, which informs the compiler that > > such references will be resolved at link time without the need for > > allocating GOT entries. > > > > To ensure that no GOT entries will creep back in, add an assertion to > > the decompressor linker script that will fire if the .got section has > > a non-zero size. > > > > Signed-off-by: Ard Biesheuvel > > --- > > arch/x86/boot/compressed/Makefile | 1 + > > arch/x86/boot/compressed/hidden.h | 19 +++++++++++++++++++ > > arch/x86/boot/compressed/vmlinux.lds.S | 1 + > > 3 files changed, 21 insertions(+) > > > > diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile > > index 5f7c262bcc99..aa9ed814e5fa 100644 > > --- a/arch/x86/boot/compressed/Makefile > > +++ b/arch/x86/boot/compressed/Makefile > > @@ -40,6 +40,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, gnu) > > KBUILD_CFLAGS += -Wno-pointer-sign > > KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) > > KBUILD_CFLAGS += -fno-asynchronous-unwind-tables > > +KBUILD_CFLAGS += -include hidden.h > > > > Ard, from the other thread [1] in case you missed it -- the plain > hidden.h fails to build in-tree. We need something like > KBUILD_CFLAGS += -include $(srctree)/$(src)/hidden.h > instead. > > [1] https://lore.kernel.org/lkml/20200526153104.GC2190602@rani.riverdale.lan/ Thanks for the reminder, but I was aware of this. I'll send out a v2 but given how close we are to the v5.7 release, this is going to be v5.8 material anyway, so let's revisit this later.