Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp42427pxa; Tue, 11 Aug 2020 16:45:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynk4/j95VpMuESBk07jloZxA7/tQ7V/JVrpF/o4xdU/VzyqWBqtuaRnnrPTaMhlbxttHlb X-Received: by 2002:a17:906:858:: with SMTP id f24mr28250027ejd.543.1597189512094; Tue, 11 Aug 2020 16:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597189512; cv=none; d=google.com; s=arc-20160816; b=p1I96RMmrTVypIYWvbtKWkVVQX5L25fG/yFC580CUJ6UDiHzKcO2YEDZbh4MF23yt/ jwMdJCefeUr2FoLy1uF036ikH3jNIUY1oI382Y6i+vIIu0TdEhBcJB0t2LpHRzaylvjJ S/ECVwl84uXjWkswn67OZp493o8NUJA2CjPiBFQZ/RG62THf6Mq1jYKQDiF6hX7svKPM jYuON0hHjiqM9r2J0KVydk45zKlXjewTtBqsg94U329SkaSkOabX47txiTbRCc/u4QPd EVtI8LjWHGPBcWhxo3eWJmHhWNfTz6aV0/QRQIkXt36xkYQ5mlkSWXT6p9fBK0FotJI7 /LUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=vVYy/T/u6izyIYXA6EUbzp0+LeJ2m23WS7/Kot+WNrE=; b=XEQ2oYOxncyVE6lYONpxij93dx5UiB5aCe6cGAq1wJLRtHoki0NfqXa1XQtwAKAO/Z gA4Kr67OZ++yeMx1oFkKgSvMPOzbogxB9ZpkHc4dtDXtgxdP4Ka5VnZk7bWnfC6f0oQW iHTSzLrvV76GcA2cmjYnjpnpyzMGOkb4XRO6C6UIGZLA1/0YDZUO8b6A7SxmRVyHRhpa uDeQDdXc3Hz36gDOdvvwqYvLO+FOoFwITbOxJTxDh3YnDIH5sq3RLDmqHox6jbc4x7DB ZTAJQheXbgNDPEXFEnRBK3EeHpDcYp+4zsH++c0gpHI4HyG3MIN+2UcxF60Iz9Ay2j73 DB3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Yby0aUts; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl8si71810ejb.425.2020.08.11.16.44.48; Tue, 11 Aug 2020 16:45:12 -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=@gmail.com header.s=20161025 header.b=Yby0aUts; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726405AbgHKXnp (ORCPT + 99 others); Tue, 11 Aug 2020 19:43:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726143AbgHKXnn (ORCPT ); Tue, 11 Aug 2020 19:43:43 -0400 Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB8F7C06174A; Tue, 11 Aug 2020 16:43:43 -0700 (PDT) Received: by mail-qt1-x843.google.com with SMTP id b25so266295qto.2; Tue, 11 Aug 2020 16:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vVYy/T/u6izyIYXA6EUbzp0+LeJ2m23WS7/Kot+WNrE=; b=Yby0aUts73aRfCsw4V6P+RYSKTwKF+8rHhYs7KENngCDKF+H++UO9BkAysZ32g3b0e lGr4e4VmnNbJo5p6UuV/ECFV2bbOblPYSXMWOJ0qVUJ5z+R+yU0Ol7MT56e2ku514rnO dLjE2ofh5qyA8ext65sVpqmx7pePdwn7O/MhO4X+8QFx21Ocv64dpn0JrLyumzF3Wu77 10Rjyn6+LoDpNJX0Kj6bI+XcjQdw0f9dcndqgKwhCGI57P+N9JEO5zrpOUSY5QL2RBvb kwM4Q39RLWo5waDKV5/Du22gSRiv8+iwmyO1ZUTk6A5Lxwrx5EpVujXBgiNyMUfbLoDB zY7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=vVYy/T/u6izyIYXA6EUbzp0+LeJ2m23WS7/Kot+WNrE=; b=qq23P0/sntn5aqXJ0hBJDjIN8kblnF2Oi7A4KKDTDUhaCtWM6Oi+ZZnHKLKOd7Lmd5 UgmKg2xCH0N1PMMPEdsuSLyA7Og1Gs7NH/qK70KQbnZOC7HOp630tSfQxXxwtn8PdK8+ 83ckehlTuNkeslfy7WKrh1moh0762JOwJzmHZqAEvX5nZrFxRqYb/M86nsD2VllBYqHx Xv3uMLa8syeWCFYnmjIIhQCKbUlE3OS+WRCyzDxxQl8N7j+WPPU+HEHsKWhpguTjRkK9 qiQzSibaa/BmtJFenjkUUM3G2VeR8WQJDyQ0Z8w5b+RMgCfPSB7KG1UlfXT3TDs7Tsdr X+qA== X-Gm-Message-State: AOAM530FB+po55WQnM+fydnoSlnNlEblaQiSg4pkB5uByz9DUv3XxsYH x52H6Fhcle8Dj2L11re1Nps= X-Received: by 2002:ac8:428f:: with SMTP id o15mr3499525qtl.213.1597189422871; Tue, 11 Aug 2020 16:43:42 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id x57sm424168qtc.61.2020.08.11.16.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2020 16:43:42 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 11 Aug 2020 19:43:40 -0400 To: Nick Desaulniers Cc: Arvind Sankar , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Fangrui Song , clang-built-linux , e5ten.arch@gmail.com, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Masahiro Yamada , Ard Biesheuvel , Kees Cook , LKML , "# 3.4.x" Subject: Re: [PATCH] x86/boot/compressed: Disable relocation relaxation for non-pie link Message-ID: <20200811234340.GA1318440@rani.riverdale.lan> References: <20200811173655.1162093-1-nivedita@alum.mit.edu> <20200811224436.GA1302731@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 11, 2020 at 04:04:40PM -0700, Nick Desaulniers wrote: > On Tue, Aug 11, 2020 at 3:44 PM Arvind Sankar wrote: > > > > On Tue, Aug 11, 2020 at 10:58:40AM -0700, Nick Desaulniers wrote: > > > > Cc: stable@vger.kernel.org # 4.19.x > > > > > > Thanks Arvind, good write up. Just curious about this stable tag, how > > > come you picked 4.19? I can see boot failures in our CI for x86+LLD > > > back to 4.9. Can we amend that tag to use `# 4.9`? I'd be happy to > > > help submit backports should they fail to apply cleanly. > > > https://travis-ci.com/github/ClangBuiltLinux/continuous-integration/builds/179237488 > > > > > > > 4.19 renamed LDFLAGS to KBUILD_LDFLAGS. For 4.4, 4.9 and 4.14 the patch > > needs to be modified, KBUILD_LDFLAGS -> LDFLAGS, so I figured we should > > submit backports separately. For 4.19 onwards, it should apply without > > changes I think. > > Cool, sounds good. I'll keep an eye out for when stable goes to pick this up. > > tglx, Ingo, BP, can we pretty please get this in tip/urgent for > inclusion into 5.9? > -- > Thanks, > ~Nick Desaulniers Another alternative is to just do this unconditionally instead of even checking for the -pie flag. None of the GOTPCRELs are in the decompressor, so they shouldn't be performance-sensitive at all. It still wouldn't apply cleanly to all the stable versions, but backporting would be even simpler. What do you think? diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 3962f592633d..10c2ba59d192 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -43,6 +43,7 @@ KBUILD_CFLAGS += -Wno-pointer-sign KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += -D__DISABLE_EXPORTS +KBUILD_CFLAGS += $(call as-option,-Wa$(comma)-mrelax-relocations=no) KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n