Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp125276pxa; Fri, 31 Jul 2020 07:59:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWuKblVyfx63ZnGVxzvOjc3yRg/NZ4qvbzUzI0LTxJXWdBoSOuUzcMpIp/02ah4NCGhBNw X-Received: by 2002:aa7:d809:: with SMTP id v9mr4287529edq.94.1596207581150; Fri, 31 Jul 2020 07:59:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596207581; cv=none; d=google.com; s=arc-20160816; b=zrOC8+41KTMJMSn7imnavsL4LWdrTv7hYIdtC1BAE4KNbQMPFEL5yPxFhXY1FyARzo 3Dn1wLjMfSZJ9d2LoLDehhfJL7HJZcW8oMJyxR9IwA2dnBksqc9f5LIKwFtOYNkb4t44 KeTVlC2Tb1mPnWlD9Um+sIWzls/hQMjWVtkHBy7qvsXJA35zotp/1xzI62/rBavThkS2 c2mXudtU7L3/7H5Wn97I+tT3DAtHbX35THc79DUKHyuLMDJ2wyoQzkCyfzIJVh0w+6Sc N33kBZ/kTw+nByvZhNAV+A4ZCPEZhRMQtsKbR4B/ErTtAkHo1SQzxhT83uEAa+kRkEwh 9jaQ== 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=CJ7CXsexIR3+9NabGND9XyABX4+Hw57eKjQc2Kl4LME=; b=ATFdiUAqv5T4Z/+bwW9UByCVw2JrRksr/vrrNQ7/wOct928k/HPR9Y+VpoK9Yjo0VV 0WukBJt/wAIxqh8AdllD6G2m3jgn5Es/83F1D9DC1ovopZ/QTvMLW8TXjI047wg5xFvw ARXItcauTnCIW+ye/2GpzcpbnvykqqR6ZhNvdADC8L8PkNZtxAdMMi7A79pqnSrBGXWF 5TJV1yGZ1JOvtujLCLIOsXN53ldyQRR6NnS9/HQsciBBEU/v6ierqg6Fgazu1QoWA2F8 C0yBgyMpJSths5voLgfeIW0iWi020JdKvi+dXphvYjInLMJq71dLIFVl4jGMJaZ/IVjp T23w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=A9qW9HTv; 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 r10si5466558eds.138.2020.07.31.07.59.19; Fri, 31 Jul 2020 07:59:41 -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=A9qW9HTv; 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 S1728961AbgGaOx5 (ORCPT + 99 others); Fri, 31 Jul 2020 10:53:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbgGaOx4 (ORCPT ); Fri, 31 Jul 2020 10:53:56 -0400 Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71AE7C061574 for ; Fri, 31 Jul 2020 07:53:56 -0700 (PDT) Received: by mail-qk1-x744.google.com with SMTP id l6so28983847qkc.6 for ; Fri, 31 Jul 2020 07:53:56 -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=CJ7CXsexIR3+9NabGND9XyABX4+Hw57eKjQc2Kl4LME=; b=A9qW9HTvWb5TMKIBHkwF+nHMq0EEp/M0lpNFJnRJhc+5+m20+yemUBtQ+blY79ZuPp pNCofC9u6kyF6/Fi98ATHwhiCraxftkHJuIsiDYUWQyVfJtpKKGugbQIsSZikdxfLh+K dczzXJm/kTUwaFUouAcgyxmxqq+Jkw6YfZ0I6r5Ca2E3FLWdJJElNf6ckc7MbkdWT30M KrbToNlaPtffRB3bkq+xpKmsDBpMywrLbP1zETaM6MR0vH+p/8OwjZ3+mq1d6/JDTOFm b/yMaJuHhLp/kBfku+JP5RrCip1++cJZwlqPkGujKdt1qcgjYizZBQbqVkeX5Cjqa8MH cZxg== 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=CJ7CXsexIR3+9NabGND9XyABX4+Hw57eKjQc2Kl4LME=; b=poI5jl/0qvxXxuojP/R7lR0hoDBYa+duJtEdyr00mKnrX0ptzOtUEuSJ46XBQNGF8m nZusDDIEOlrhdFK4DGYj+n2zZOlt+zk6ubjcSeMsN8f1kZOYA9huXeW1NxhVy9b8d4S8 ZUpMfltASci5HV+LUANvXfNtQVayd5lAcfYMNT8oupu4liko5zomHai8laCUp5cf6a4H bQEVcawP/JkjdkrCEUeYcqTvnhtpzKjGX3AmmxClRbcgoKhkaed301lw9YKakTNeDbKp gQ0HoJRQ9Bn14xMMVF/WSjm8U/Z22Wm1GVdk7mxLF07+66c4ZQuvev9T2ad0FvIVha7o 35iw== X-Gm-Message-State: AOAM532A9XYyLWCANySKeQoR2HhJPcpJIlJfZ1x8VbihyPBOXhb2vGZC dbnK4ZsOPYYbTn41fILJQ6E= X-Received: by 2002:a05:620a:22ee:: with SMTP id p14mr4542341qki.223.1596207235574; Fri, 31 Jul 2020 07:53:55 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id x29sm8713166qtv.80.2020.07.31.07.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 07:53:54 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Fri, 31 Jul 2020 10:53:52 -0400 To: Kees Cook Cc: Ard Biesheuvel , Thomas Gleixner , Borislav Petkov , Nick Desaulniers , Arvind Sankar , Ingo Molnar , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Fangrui Song , Dmitry Golovin , clang-built-linux , Masahiro Yamada , Sedat Dilek , Nathan Chancellor , Arnd Bergmann , "H . J . Lu" , LKML Subject: Re: [PATCH v5 0/7] x86/boot: Remove run-time relocations from compressed kernel Message-ID: <20200731145352.GA2076085@rani.riverdale.lan> References: <20200714023836.2310569-1-nivedita@alum.mit.edu> <20200715004133.1430068-1-nivedita@alum.mit.edu> <20200717134654.GA3187880@rani.riverdale.lan> <202007241624.D59FB48@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <202007241624.D59FB48@keescook> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?