Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1048432ybm; Wed, 27 May 2020 14:53:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu6XO9+7NEMjzWlZ7plje2KPXUDlEsOPth4LFzLGus5ito0jbXK12tVVoAbwNJDmNEJxzC X-Received: by 2002:a05:6402:128f:: with SMTP id w15mr202929edv.240.1590616388197; Wed, 27 May 2020 14:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590616388; cv=none; d=google.com; s=arc-20160816; b=UY9JE5lhOzbTuuQkfXJCgvhzgdudzYbYkl4HIPE1gP2Pglg6/d6Q3GsyPnPPO0WHrC wmr2p6AO1YYm5Ef/pfyP7tQyBVv+WTAqQOjxcD6DX/E0fgbNmRM/CvFXUcEoh+/aE4oz 8UH/NQBVBtPn4rL7gO4xrbZpsfaugA7mNY/NqHYxbkuJK+c680XWvVQ3gWE2ppWcGIYS /qgiFPez+OtWN9ffZajvI844jpjhvUDfjhVu410I83e2blntEAv9ZcmHrNnw70XoWaVC VUOJ9hEvC9Dlfe18fpD1ASTV7t+uXUj3ygDQ3AKHfwyFB47XfWX8/1yn0zG66xMguTOo 8Pug== 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=FW8Q9Rorz9pPYc/xr3AkQmCBY01IskGBSmgwhtvJ9ZU=; b=k0TGNmbApyVGos8TqLMmJg1KF5lpjVKn0BN7i47nZGDsmPwOH6tCyt9UpMoEO3NhVb JGQcb1zPw+MuO7RukB/qRY2pl6ZTn6/xUEi9pDbk7azV6KcuB53bTELSgiplmXnmbZ5N nslXprZ9UJ2OQXuvjKpfFr22mtvayt+1YZmOfWU7aB4ucwTXPm3gvIHmaeLMENzcG9m2 oIHfCMvFtEzto+XQolyDkofZn48J0JduiA2MjGvt3HDzwQUUezgzqQv+UDXxCbJIiMMp 1TK8nIkpCwKqXTYtJDEEGt80NIZ3HKQP5T80W5Nd6XMyyyrYGN+WVfMUJOrNrEy312hF p10A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sZtyFQOR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x38si2298700ede.433.2020.05.27.14.52.45; Wed, 27 May 2020 14:53:08 -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=@gmail.com header.s=20161025 header.b=sZtyFQOR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728068AbgE0Ssv (ORCPT + 99 others); Wed, 27 May 2020 14:48:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbgE0Srg (ORCPT ); Wed, 27 May 2020 14:47:36 -0400 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DF79C08C5C3; Wed, 27 May 2020 11:29:13 -0700 (PDT) Received: by mail-io1-xd44.google.com with SMTP id h10so27159609iob.10; Wed, 27 May 2020 11:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FW8Q9Rorz9pPYc/xr3AkQmCBY01IskGBSmgwhtvJ9ZU=; b=sZtyFQORrPLQ4OmmN95ukhbr9eaO4A0bRAoSlF5lwld76UrlDxnqypcamYyZpQ0AKV zLq/+vZ7EKnSzTICk4F5MqdhPiIliA6GZHvGRUyHrAdiE4Y9Bl1oMG6fzDbyDcjb+2Ng TPq4XyNGzDlZV03yi9zrIlFCURC3zvRe0M36EhkoPKGiMxmfrWuYVz9zCniCv/epCuLw 3WMd2NUY/g7cAvZtI+Kkuu5LLfQ5GLAcw9keDaFUOGQlgbYRgEp5woAZvDmgna+TyQHX sEmUL/oBKUXwoxEBd0udHuvYcwFHsiDwJ85qcIqhsXrUap6I7Jhi+/kOV6fcFRHvrylS iz5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FW8Q9Rorz9pPYc/xr3AkQmCBY01IskGBSmgwhtvJ9ZU=; b=nQ5wCdAK6vlvjz9P0gHrFWqyYFAOsmz6oZDjU6Rv64iFAlMINxi2sFPQHBt92Dl1pa 4Kko3axL1GHpo7nkQb0j91D/5HbZP860xcR06ZbqYBeZIs9xKmqdiDMeufaJSRVhxKMi NSvmmhogP6wnuptL/apuGfFSLEJvJX/PKEg1ZuhDy8CT+JHFGJ+6GPpfkTBdA+0cO/24 PhXNugVYhW0qCwNIO7GFAZub8ezWpbWs0L32GoV31hF2brfJJAQBdLIDM/daCPdISRx7 W4iPoYEV1cjKgx5rKe42e9uotmx6I/5SK3DnZQub0gPmZSb6BjLI7ZC304s/FgKbBID7 op2Q== X-Gm-Message-State: AOAM532Jb/Vnh/qzXOUqJNJlXtHZaKkXnjkSqH7J1O/V8NQuufSLs6Uz 8RvOhfQIPnV3AA6QpdP2TZkcEhBU8e+fw/7Idw== X-Received: by 2002:a5d:9758:: with SMTP id c24mr21786555ioo.144.1590604152179; Wed, 27 May 2020 11:29:12 -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: Brian Gerst Date: Wed, 27 May 2020 14:29:01 -0400 Message-ID: Subject: Re: [PATCH v2 2/3] x86/boot/compressed: force hidden visibility for all symbol references To: Arvind Sankar Cc: Ard Biesheuvel , linux-efi@vger.kernel.org, "the arch/x86 maintainers" , 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, May 27, 2020 at 2:08 PM 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/ How about using -fvisibility=hidden instead of including this header? -- Brian Gerst