Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp672873pxa; Wed, 12 Aug 2020 10:41:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS0I8CdUNX+Ve41QhXMP/ZVMH/3omoKqWpeJp8/jhG92IwUjuoaTwWM+q8kgBVBaNOPV9a X-Received: by 2002:a17:906:af51:: with SMTP id ly17mr867554ejb.81.1597254118214; Wed, 12 Aug 2020 10:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597254118; cv=none; d=google.com; s=arc-20160816; b=TWhMIDhalJXr7Z3G5r76rgJdq266TsrRIOZD/FsvTJYusaZgy9F5dV4q82+aakEYsP /ffV3O5PYQbVB7e4lj3R6A8FmT7mZeDe/PyNe///6kWexmoQ9s9C93Ba2ZCcHF+27sJj buQ3xuLiR7yeCMyDGALbFGrVelLpVxuEvmRsDs3WNYG3N1zkoQ3euUSFEjtpVJuAXFff jcesZW896lCOgB+jxRTEn/sMI/cjksOkSW7WeLESNqoDp7kbMFSVJvFCuubpzcSz1DHm H42n7Yd8Sk9fDQ3iGmrLK6KvD8mxXJEFkgyHUAooD1eQESLw36wCLl7G5DvZ7idDKdXm XIcg== 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=M+nw0tzUCelBAby2tkOpTqz2VXzgt4Q4iLKx4BxN7dk=; b=fvpVWk9O3SiStEaN4Bls+LaKDo7zCcGe0sHJfpQfv0cRZx9Db8dcojTsqtrI9Mkbgu EhZdOV5zkHHmzDh2CXJCticUHK+SRb6Mo9EuR6u3f5YU9IwGHcgVN5OFXIpOZukvd3N6 V8R4+QNHbrTOL3wbD+TRI+Vtm4e937iJFTD5GRVnLb63jX41kONYL6DnlknrKmrOQU+b JNVtfMHFd0owNBsoRNjXjjCe2iqQeReozSqkfXQRYrmSTlG9y9wOMaRYjE9EscwDTFb3 uqpDC1aGyHCUDro9qcO+SyrsjSV1j80Gc97tulpxX64nE+g+Tpcz0XSZjv5IVdfdx45z ZjDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=aTw6NC1z; 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 x25si1648431ejy.383.2020.08.12.10.41.35; Wed, 12 Aug 2020 10:41:58 -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=aTw6NC1z; 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 S1726612AbgHLRjz (ORCPT + 99 others); Wed, 12 Aug 2020 13:39:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbgHLRjy (ORCPT ); Wed, 12 Aug 2020 13:39:54 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C08B7C061383 for ; Wed, 12 Aug 2020 10:39:53 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id a79so1370969pfa.8 for ; Wed, 12 Aug 2020 10:39:53 -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=M+nw0tzUCelBAby2tkOpTqz2VXzgt4Q4iLKx4BxN7dk=; b=aTw6NC1zqiue7pEcocQoxkus0jUNzxX+1+Pk27WWiD5wLyEtYoSJcRJPD3gC0lLKJZ Ft8GDVVf/oaVtyQUSFlhGxK3/dHVH+0TR/D2UpQGsVmwZUJdMOcMIyHQtbOqM6dBwQdD IRxQLQ9q0bmPqmSuWaW5FI2+6ZxsD1a3Reu42avCQPML9Y5BtyjCprJBjKr49zZDFD2r EEJOFh8lsi+pyr8gjdMXD1jdeRoF063fEvmNTOLV8xBKAlGhYOWHxnDbdbGvujpuL9ka mgLcZLyxbt7XU7T0X3ocNMCU7WCuiLOhzBSd2idGdOme4jGIrx03/xeUL4BLQuuTsPc1 bRSw== 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=M+nw0tzUCelBAby2tkOpTqz2VXzgt4Q4iLKx4BxN7dk=; b=QZPz4oHsgsGGtkZ8n4Jc0uyDXBqJmeSNDz5LSfxd3YfmcWvSno+7gXgWi/L5/Rpetv i/4WAtj6qem72FgTFlMZSw5nkVOumSwuq7hBmsApm4Ss77GxApKXQEH2wKG6tewAUrqa uJvO3zO6VxDGugddSJPFSJsqrzBypMTdR8nq12O4dALOvYuNcNuhUaDfqwPJ+zIAK2Wz zEd3IQ/hQF2WCebEi68h/qRmNKDZZcUlRnMybNWxR75qLC1t+gX8r2l5MZwAXPC+Cygy 82XOKo5XVlEVS4elL8b30Uub2GLc/BOjXshWDR45yb2t62kygTh1wD1eXAmYWZavynTo dRrQ== X-Gm-Message-State: AOAM533jTKjNZKJcSkRmt9TrgwVjgtJo0DlZvxS4fCJYeVLNdpVSy6I1 yNtwrQTk+TWbY6Ao2M19BnRSkMEivcgFaOEBiyp3LQ== X-Received: by 2002:a62:8303:: with SMTP id h3mr586947pfe.169.1597253992588; Wed, 12 Aug 2020 10:39:52 -0700 (PDT) MIME-Version: 1.0 References: <20200811173655.1162093-1-nivedita@alum.mit.edu> <20200811224436.GA1302731@rani.riverdale.lan> <20200811234340.GA1318440@rani.riverdale.lan> <20200812004158.GA1447296@rani.riverdale.lan> In-Reply-To: <20200812004158.GA1447296@rani.riverdale.lan> From: Nick Desaulniers Date: Wed, 12 Aug 2020 10:39:41 -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 5:42 PM Arvind Sankar wrote: > > On Tue, Aug 11, 2020 at 04:51:23PM -0700, Nick Desaulniers wrote: > > 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 > > KBUILD_CFLAGS gets included into KBUILD_AFLAGS, so this already does > that. Ah, right, just below it in the diff. > > > 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 -- Thanks, ~Nick Desaulniers