Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp73421pxa; Tue, 11 Aug 2020 17:45:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp0iZlnVillHPdbkU5barLYxUi70ADL9FqP1k0MpKayoRnIPb2wDKz2otwu+qXaFdxR/As X-Received: by 2002:a50:b701:: with SMTP id g1mr10159768ede.197.1597193158445; Tue, 11 Aug 2020 17:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597193158; cv=none; d=google.com; s=arc-20160816; b=x2nZTGOUu4zVnmBQ9O+feNZTm0yvlcMI8yIefH1ITHKXHMoD2U3C4UokDk2nxGQaUQ FqZpx74h+S9VCMj2Li4/W/EpTkAtd1mSB4sI44IzhhMvud4eUDJzSfA4EqGWLoNoDqG3 X41csIZhi7NQG0lNewD6Myl4iS1q9KGvbMPMay1tIIg9FFmIRTRLh3H+PklRwrPX03W3 ZZRCIoSUN9y78W929b3xcS5t25gLkx25IaM0dSzY+UGzs7DKkyAzifTPMKe+mAPzExGy o7SWkxE8rjRl0trV/W0DFSnLNjQObzaCAON+5yU50wu2tUP2oQSQsHsMWW8ZQ3mNuprc jHMQ== 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=xKVZMt/dePQM4MuKFNd6Ajk9D8rVSs9BrWtvNC9qc9Q=; b=XlS2o9lWOBOsM6GCNyLczayY+XB4s1StvQKA6MQ/6lvYSTZfx2HI5BA7bOXXuvMYMb TvychRF3IuDGr6YJefWy2h/EysbCJCTf/E2B6OLggLkNwWI5PbwrhG6q9hwxT2uESYok 8Uh3t/muzfPwTB96ESS10PSCKDihbk9fhcaFf2zFcP03xj2phEA9bPEK4oiyB2shp+tH t9fbTeo1O/96nyU8dnx89mokXkQYzPFve5fnVRrHPsiQLTvYDqmWXrRZm6+1h8mCkL2N 8TzqCaoUKnayT3CIjsKdunK2Cq9F3N2iJh0Cy5VCDae0Z7GmVgSwGWX5RYleehkp3o4s scxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=eUizsHu8; 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 bi9si310870edb.366.2020.08.11.17.45.31; Tue, 11 Aug 2020 17:45: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=fail header.i=@gmail.com header.s=20161025 header.b=eUizsHu8; 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 S1726422AbgHLAmC (ORCPT + 99 others); Tue, 11 Aug 2020 20:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbgHLAmB (ORCPT ); Tue, 11 Aug 2020 20:42:01 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 794E9C06174A; Tue, 11 Aug 2020 17:42:01 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id dd12so319777qvb.0; Tue, 11 Aug 2020 17:42:01 -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=xKVZMt/dePQM4MuKFNd6Ajk9D8rVSs9BrWtvNC9qc9Q=; b=eUizsHu8R2pQS6jRVnAREKzRnltxbHGsHDlbgl5HiZ8T5WP5v7R/FdXEW5olp9Ng4m l+bFua7uNOEktthT8oYm4yfGaNTfxvC66ef1WD9u+GtMj3ENvmgEKl9eOksAcY8lu8Qm 1K7I6by5x4eB0w4Iuf5XNtn5c90/CC9bdgZPoJ1GssLh3FVQGF4hZpbCur0oV53CKL8z w930PnLmAWlzYH7IkdedzATG4omTW+TFM8xH8gI2nTzShFENKKPraETMzUBJjQrNCfHH ccB/MSJUxR2xoQJzlWkIXPiAwqg7vVGVIW6H5gqZfugaLeHstlrWLHNy/BAlS+wUfQc3 L8Ww== 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=xKVZMt/dePQM4MuKFNd6Ajk9D8rVSs9BrWtvNC9qc9Q=; b=nTCMeobPWgHCvE30bJMnUr8OZ6EkjxWu1DcmndUfVT1wuC3Py/Zf907ky2hNkkRc6N Q7goBzQ08na8IsOvHIUveh7g2N0tJfVyOyNHnfTPOBzFTDnYYILHA1gN5wnANZkrr/Jj ZRjD9HBC5PBYMkNYms2We1V4JczIBoFHMhvoPz+BrkkaX0AxOpEvHct5dSqa8GShujTJ WTrd9kuglRXafb6dbIRN0NM8tpVw3O+2z2ncFj/fB2W7AN/BrHVRkq1gEre8Hg7wZdHT UbnkVwxKVOR1lH/kQQUvuiFfSAXXuhyPAS2tJ/gkvqD2MAgVu84EahVniAj2yhmFkNKZ mEgQ== X-Gm-Message-State: AOAM530xNHexvhepuSnlUTSfpTF5heNU67dFXjFHl/YHhVekffjP+Qj6 ivVJISo3XqiYyGVUr1L1c+U= X-Received: by 2002:ad4:4089:: with SMTP id l9mr4196623qvp.175.1597192920425; Tue, 11 Aug 2020 17:42:00 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id w58sm544891qth.95.2020.08.11.17.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Aug 2020 17:41:59 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 11 Aug 2020 20:41:58 -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: <20200812004158.GA1447296@rani.riverdale.lan> References: <20200811173655.1162093-1-nivedita@alum.mit.edu> <20200811224436.GA1302731@rani.riverdale.lan> <20200811234340.GA1318440@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: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. > 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