Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp126224pxa; Fri, 31 Jul 2020 08:00:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+Sk4vRYukO+tTgSc82zzisV0dDC41DkO69sBLKdPZcy6iAOT2SNt9Q4lsqaPRbFvFkAER X-Received: by 2002:aa7:cb56:: with SMTP id w22mr4187199edt.96.1596207651291; Fri, 31 Jul 2020 08:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596207651; cv=none; d=google.com; s=arc-20160816; b=pHZExzZwYNHTeKwpSaGcMA5OCRuVphclr6Cu78lLn0dQsWTGjOq+rSS/oGy+kBb8mA t9yoSDUDBzihk2dbWA6ZCJM5+sonXw8/Ocr2pk5ErXfjHVr9WxHxJ7W1Qp04aZ+pag53 kQU2f2sYhSactZJ/8Tfkna1PCHbllMCiYph5CrGNIqvd9oS0pSGw4KGp8UKhFbZ42Gdk P/ln67JKBphYQ88jiWlkEAD5p22iQJK52oIqPukgOine1aAxzUXFjINBVu2ps6Lc/E2H ajay5jXf28i9w3Nlb9XmPfuZwthPcKs6zjxjIa6ibYWtCvt4rKgvmWayXUXD8EXTTg2E 0WeA== 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 :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=HT0VjPF40Ntd8YWFXRJUxrumgrtjSgN7H3boxsBygfs=; b=nGXsJJLl0SxSWzAaSVlQsJB26AaFoRabZf4HgGqUL9wC3hr2bmy4n1CA9v446Ow2GZ 1hWNMJGGVoimToFzPhDvowz8xkyd1gaw+9B2NTf8uaJHMt84QDp+pMNRbJo6YRWFUCx4 UjCu1dOpzyV85WdSae/lYftKjrV0XrjbQmwWomiZXnUVOfsAGZrZ6Ag6Ov1UCQTS4S4B Nc8lEHKqXE4BH9v78ztrSUvQRVdW9d2vD64W5e67pWPPO7/TgRqg+HOtpHiJIBoNUR3J B+VrsZBlwjGzuKTyGT97hwyLAtS89frGoG2DEhv7jtsBC3ZWliBj5T24EsHlk+ygxeg7 RtLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LZe66L7q; 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 a9si5205035ejf.124.2020.07.31.08.00.28; Fri, 31 Jul 2020 08:00:51 -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=LZe66L7q; 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 S1729511AbgGaO7I (ORCPT + 99 others); Fri, 31 Jul 2020 10:59:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728713AbgGaO7H (ORCPT ); Fri, 31 Jul 2020 10:59:07 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4CB6C061574 for ; Fri, 31 Jul 2020 07:59:07 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id u24so17055432oiv.7 for ; Fri, 31 Jul 2020 07:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=HT0VjPF40Ntd8YWFXRJUxrumgrtjSgN7H3boxsBygfs=; b=LZe66L7qtKUkrlivnJ9bVitlCJU96riM+uLHmUsBpa4vdY+2GPu4MeqdyfZoXADcRl a/SYozykGxYANMZA52S/d5hqDLPYaPxGyazE+UHdeuqzFHmpE/XLk1mKXrT0rELzsLE3 CIHQtHgN2hq006n9prpsjRIFa7q/0lpwG4EbJeikpd47ILRijj07kw5jtpmduiqRKo9D EJCu2Hzm+T7jhYZT4MRoJoiUAvr6h0b7N5XsMBwrD6odxy6rj4Y42hUWTecwkhwaPC0d j0C6yBGqh3M74J2kxJPPrnGqF0iRXnm4E64p4ArqnmIewy0yYXpH2kfqzui+EkHmtytg Pq3g== 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:reply-to :from:date:message-id:subject:to:cc; bh=HT0VjPF40Ntd8YWFXRJUxrumgrtjSgN7H3boxsBygfs=; b=eoXSuumaBHG4KEq/mI3I+iPYTg3nq8uc1KkmeGWuoCCiKJ55XcPQaNV3JJCNT0PqFY nUioZoMsDb9rubCJ9R1GIXvvCmQNt8WBCxiNy7mhPTHQ1jV3IZgxwIcypNQv3LlNbXkl hNvcg1K8UjLiL4NjROrYWCwCiBUYdWhx8c0Bu/dHleS7hyeivOk8pIUK73xPoYVFfmFT WaIqE4vFJLtIaUL4J1cVqDz///x/lpU0sO+owSAD9+Kke+cotfqI/wBMXgQFwPSz4q8L EfKutX9c2KWKcCe8xgf9WEq5QHJF5Nq8O5vaZr2/LL/QmZX95xZpkGh8etQ0FS8/+vuo LaQA== X-Gm-Message-State: AOAM531yLleTBncTQ8lVhpLY/dR13OPwphEWuFb0rBW39WTZ0Z+mIDvD yVDQKQA56M7WPA6+k2efwLBWr9rv4r3CWTWYyc4= X-Received: by 2002:a05:6808:311:: with SMTP id i17mr3409866oie.72.1596207547007; Fri, 31 Jul 2020 07:59:07 -0700 (PDT) MIME-Version: 1.0 References: <20200714023836.2310569-1-nivedita@alum.mit.edu> <20200715004133.1430068-1-nivedita@alum.mit.edu> <20200717134654.GA3187880@rani.riverdale.lan> <202007241624.D59FB48@keescook> <20200731145352.GA2076085@rani.riverdale.lan> In-Reply-To: <20200731145352.GA2076085@rani.riverdale.lan> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Fri, 31 Jul 2020 16:58:55 +0200 Message-ID: Subject: Re: [PATCH v5 0/7] x86/boot: Remove run-time relocations from compressed kernel To: Arvind Sankar Cc: Kees Cook , Ard Biesheuvel , Thomas Gleixner , Borislav Petkov , Nick Desaulniers , Ingo Molnar , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Fangrui Song , Dmitry Golovin , clang-built-linux , Masahiro Yamada , Nathan Chancellor , Arnd Bergmann , "H . J . Lu" , LKML 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 Fri, Jul 31, 2020 at 4:53 PM Arvind Sankar wrote: > > On Fri, Jul 24, 2020 at 04:25:20PM -0700, Kees Cook wrote: > > On Sat, Jul 18, 2020 at 08:44:50AM +0300, Ard Biesheuvel wrote: > > > On Fri, 17 Jul 2020 at 21:17, Nick Desaulniers wrote: > > > > > > > > On Fri, Jul 17, 2020 at 6:46 AM Arvind Sankar wrote: > > > > > > > > > > On Tue, Jul 14, 2020 at 08:41:26PM -0400, Arvind Sankar wrote: > > > > > > The compressed kernel currently contains bogus run-time relocations in > > > > > > the startup code in head_{32,64}.S, which are generated by the linker, > > > > > > but must not actually be processed at run-time. > > > > > > > > > > > > This generates warnings when linking with the BFD linker, and errors > > > > > > with LLD, which defaults to erroring on run-time relocations in read-only > > > > > > sections. It also requires the -z noreloc-overflow hack for the 64-bit > > > > > > kernel, which prevents us from linking it as -pie on an older BFD linker > > > > > > (<= 2.26) or on LLD, because the locations that are to be apparently > > > > > > relocated are only 32-bits in size and so cannot really have > > > > > > R_X86_64_RELATIVE relocations. > > > > > > > > > > > > This series aims to get rid of these relocations. I've build- and > > > > > > boot-tested with combinations of clang/gcc-10 with lld/bfd-2.34, and > > > > > > gcc-4.9.0 with bfd-2.24, skipping clang on 32-bit because it currently > > > > > > has other issues [0]. > > > > > > > > > > > > > > > > Hi Thomas, Ingo, Borislav, would you be able to take a look over this > > > > > series in time for 5.9? > > > > > > > > Hi Arvind, thanks for the series; I'm behind on testing. When I try > > > > to apply this series on top of linux-next, I get a collision in > > > > drivers/firmware/efi/libstub/Makefile:27 when applying "0002 > > > > x86/boot/compressed: Force hidden visibility for all symbol > > > > references". Would you mind refreshing the series to avoid that > > > > collision? > > > > > > That is not the right way to deal with conflicts against -next. > > > > > > This series targets the -tip tree, and applies fine against it. If you > > > want to apply it on some other tree and test it, that is fine, and > > > highly appreciated, but 'refreshing' the series against -next means it > > > no longer applies to -tip, and may be based on unidentified conflict > > > resolutions performed by Stephen that the maintainers will have to > > > deal with. > > > > > > Boris, Ingo, Thomas, > > > > > > Mind taking v5 of this series? (With Nick's Tested-by) I think these > > > patches have been simmering long enough. Do note there is a conflict > > > against the kbuild tree, but the resolution should be straightforward. > > > > I would love that; I need to rebase my orphan series on this too... > > > > -- > > Kees Cook > > Ping? I just tested v5 against Linux v5.8-rc7 and the conflict you mention is with: commit da05b143a308bd6a7a444401f9732678ae63fc70 x86/boot: Don't add the EFI stub to targets If I forgot... Tested-by: Sedat Dilek - Sedat -