Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp45887pxa; Tue, 11 Aug 2020 16:52:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDvuf135CraOws7me5FcbAj7KTHH8qR6DeKApGubE+cHGFWeuuHN0xfrxLIh01TC/wGtor X-Received: by 2002:a17:906:3ac4:: with SMTP id z4mr27039006ejd.65.1597189974825; Tue, 11 Aug 2020 16:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597189974; cv=none; d=google.com; s=arc-20160816; b=vRkXX1CW+fpuO2A6Ll6U1omHiO3FJ7EnXELLaziLkP6oFgZciEP7l9aEtDyZEq8QjE OAhvZZpRoL6lAt3weUPsqIYGZ+XGf4j7S9qtQSrtJrDP3I2RizbXkYFBmL6OndfYombb 60QZyju+GXaX+4MWeRn+hOBzx9VqvGTfSLkwTOZBhr+5FZs2Ov0xELPMeA/0YiA2Xqy9 2K30Wv898QKSn3zi7tXknMdmRiEeiXzZNNECaSrhKnOAp/80QGVBwGwr0bf5nvgv/pSi wSZMMH1hbTglpMelrrzxlVUegzkiph7bxCOcaU6F/8v7ceHQyvs5R3e1iYKfbO/uA0xt 5CEw== 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=y1qDjAS8ZPDC4LMj3s+e938rgxLp1azn8ZYiupGKT1A=; b=r8OyMYFflS6yEEQiyWV7FGKcpA1h5TQoADWcUDp1UIrClevYFpptiAnZtkim7RVfJF ccyfQbX+gQnDhHFZZU5Uw+ELCSUESTYBe3Yxo6ChBA+Y7Bx1fK1DNnd7av189mQavgUS cW+AsfXs3errq99vpRHlBfhDCa+uexxDDNDBgRcfGtq0yY3uEkusnf8wgTSDvfj9EC5A diV2MwPBgQEcqf9lDrt7vwAvDSki/eO7CWJGY+7n3Jqf3w9Mm31tjA+bZDPMvpepC/wT yyC96ypSwiHe68Nw1DWOR0AsVhJWZVzOTCdG5zJgrejK3RNcmZh05I11I/0YMx2GZgsm MxuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=LSyGz2XP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k21si78379eja.290.2020.08.11.16.52.29; Tue, 11 Aug 2020 16:52: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=pass header.i=@google.com header.s=20161025 header.b=LSyGz2XP; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726274AbgHKXvg (ORCPT + 99 others); Tue, 11 Aug 2020 19:51:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgHKXvg (ORCPT ); Tue, 11 Aug 2020 19:51:36 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B509C061787 for ; Tue, 11 Aug 2020 16:51:36 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id y6so283873plt.3 for ; Tue, 11 Aug 2020 16:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y1qDjAS8ZPDC4LMj3s+e938rgxLp1azn8ZYiupGKT1A=; b=LSyGz2XPxyFM3a7EELo0+9cZruahgSS3Xdj43kI3SsqFLqLvmHR+4jQZUM4MlywVGs ejzocF7Unh99hy/ZX0lwkFBotZ5g2ke1cdra15udZNChK/2h4QNfEjKvQcJeh4JHuWq8 YuOyhdvE4oeumVeErrDAroO4irfdR/E7I1U4J2oNcLp/qv4kO7d0TJ7wi57BuLY8vjnp ExLi2Vt3JYjlRDAGLR27Bi4ACwfIa1FcbEGIZ5zE1/eLOykhF3762DP/UR/2MhQtcVt6 bGEgyDKsoVooUyMnrRKxG1v8lf0B4h7lrl4Bu13FAQzlaulBqSLNvrmDn16yd7UkimTi SsiA== 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=y1qDjAS8ZPDC4LMj3s+e938rgxLp1azn8ZYiupGKT1A=; b=BzJKTcexXqBrLvr/Upwx+1unelcTXhXwanl1k5THWTZINctWTYrlS2TL9SDvQf9ZFy 6BsEeZv31lYCK+qmREZv9NKFSl6vuYV9uKujHguiz4v369OgtBS+cTU1vX78++IBPXVK JRYN2ZCeptlLQKPI9qipTaBGkp5dYojXiKlL8OJlPJ833WNDa2O+vkWcsN0B0JDchZpp ZazI6QZtbsudH2nBav99ynwpRcxMAgLQWor9XPp0Soc+Cj8g787Ph40aruS4MZeUnoHd e9e1R0ND1PD2wmZ1AexA0/ZP7plstxmAMvymfc6Aja1akUo7oKV8LUlYmjYh7UJK+VFk PJvA== X-Gm-Message-State: AOAM530pgIliJQUmRhXOb5iLYV7MOub+8T4JmJRX1L9MnvC1VMfPGiou +aPpX8DmQXozdgnAF+mzGq4CE9B1+mc18MHCDQOQHQ== X-Received: by 2002:a17:90a:fc98:: with SMTP id ci24mr3603977pjb.101.1597189895220; Tue, 11 Aug 2020 16:51:35 -0700 (PDT) MIME-Version: 1.0 References: <20200811173655.1162093-1-nivedita@alum.mit.edu> <20200811224436.GA1302731@rani.riverdale.lan> <20200811234340.GA1318440@rani.riverdale.lan> In-Reply-To: <20200811234340.GA1318440@rani.riverdale.lan> From: Nick Desaulniers Date: Tue, 11 Aug 2020 16:51:23 -0700 Message-ID: Subject: Re: [PATCH] x86/boot/compressed: Disable relocation relaxation for non-pie link To: Arvind Sankar Cc: 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" 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 Tue, Aug 11, 2020 at 4:43 PM Arvind Sankar wrote: > > 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) We'd still want it for KBUILD_AFLAGS, too, just to be safe. Maybe a one line comment to the effect of `# remove me once we can link as -pie` would help us rip off this band-aid in the future? It's more obvious that the added hunk can be reverted once -pie linkage is achieved with the current patch; either are fine by me. Thanks! > > KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ > GCOV_PROFILE := n -- Thanks, ~Nick Desaulniers