Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2986867ybt; Mon, 29 Jun 2020 12:11:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU06U1HHQzRZQGeWztVoRELCuxpVBoDcWp2APe44+Q42GeFSXlNVWjGKYkGFJDqB4TRIN9 X-Received: by 2002:a17:906:6a14:: with SMTP id o20mr15682598ejr.128.1593457863113; Mon, 29 Jun 2020 12:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593457863; cv=none; d=google.com; s=arc-20160816; b=0S0zyRwJPvacRItn0q2CcrBPbeUWiy4BF2G+ie3AeDmtVpsjOylM+kUb+6tXHfN2vz K2rIeFhKIZvceasJgB5V0cOm2iCeU+ydpg8Hw+WAG88P7eNpY1IAbbN4HdUkoT+JsXS1 f+C+JP9iCwPnof1sOvyrzAI+eRzZ203RePQ0BpjFxk3vOngoqe4NW4S+W5wn7yHPmj/f d2CIBpmsLMUxoR+7KaymwG6HYEfsVbuvFB6VauJje6CiVrYITGMX/pW7CysBiZNyu98l 4PfPYNUGofVZAqENamgqLlGYfroBX5ePqRSnuAMiaRcqjGD+ZV9lMV9RAd9zk0fUHnr5 RRgA== 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=0lZXh50AD5hTdzGfIns1A+oqNRPm9tukhEcGmv1GzA8=; b=KSBHNFWNSJlr3+xv+7+tIE/v2CwUE+nvajZunV06H3DYvV2e1egH6sPHXZKsBbkvJt vrrV1AQJ20ZdLivgLaaw1RAT45wIHECHnypP8D2PPb+7dJ94F6JDYEl9OWa95xtpkBEz UPjLTSIWqU7b65Z+QwsRIJG2YmX2Xp6L4jVuKiqejYYO+SizhWgF0u+/avVo12czCw6l prHQCcL67Yd15bHP+G4ieMXDLhquMLgc+I5gQuYr7WQV5bhAAND9FAlXwJ2uZJKXBdig tPTpksM4ndx3MvGveSN97Ur9I+6gLbU5QRMDE5BSeeq49GLMljFUA+YYb1UifjrwpIOd ynJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sWtK2vH7; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ob20si288581ejb.646.2020.06.29.12.10.39; Mon, 29 Jun 2020 12:11:03 -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=@kernel.org header.s=default header.b=sWtK2vH7; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730997AbgF2TKZ (ORCPT + 99 others); Mon, 29 Jun 2020 15:10:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:53728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730958AbgF2TKS (ORCPT ); Mon, 29 Jun 2020 15:10:18 -0400 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD12B2549E for ; Mon, 29 Jun 2020 15:51:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593445872; bh=eQgDUs7J8VJ3ysHeL4WQSn/WO/okfHnq/562AgtsAk0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sWtK2vH7PYP2j67ezQzJinF0yOJF+6ZsFB2IytMjLVWP4giLRm4ykPrk7oDW5qgSg wIN8EeaGhVXUlPqcRVpEQe8bSW7YUQ0m6YRDEgbRsnB/EgKnOFVKBctGnOJS3AT4th MK5gWfzupsZmaePqKZCKr/bdvO+Ji/aHR2/+ONrE= Received: by mail-ot1-f51.google.com with SMTP id w17so8097543otl.4 for ; Mon, 29 Jun 2020 08:51:12 -0700 (PDT) X-Gm-Message-State: AOAM533LJJIOmfTx51AOC/NQqrLoXjHPjkAE6Fr3KLs2T+A1e/iNQQbl 4Bs3GuQvu2C677ybgpZcC0urwkg5WQ9VqWxc204= X-Received: by 2002:a9d:688:: with SMTP id 8mr13766245otx.108.1593445871914; Mon, 29 Jun 2020 08:51:11 -0700 (PDT) MIME-Version: 1.0 References: <20200629140928.858507-1-nivedita@alum.mit.edu> <20200629140928.858507-2-nivedita@alum.mit.edu> <202006290846.5A5C76A4D7@keescook> <20200629155011.GA900899@rani.riverdale.lan> In-Reply-To: <20200629155011.GA900899@rani.riverdale.lan> From: Ard Biesheuvel Date: Mon, 29 Jun 2020 17:51:00 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/7] x86/boot/compressed: Move .got.plt entries out of the .got section To: Arvind Sankar Cc: Kees Cook , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , Nick Desaulniers , Fangrui Song , Dmitry Golovin , clang-built-linux , Masahiro Yamada , Daniel Kiper , Sedat Dilek , Nathan Chancellor , Arnd Bergmann , "H . J . Lu" , Linux Kernel Mailing List 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 Mon, 29 Jun 2020 at 17:50, Arvind Sankar wrote: > > On Mon, Jun 29, 2020 at 08:48:05AM -0700, Kees Cook wrote: > > On Mon, Jun 29, 2020 at 10:09:22AM -0400, Arvind Sankar wrote: > > > > This is also being done on arm64, and the section was specified slightly > > differently (with INFO) which maybe should be done here too? > > I was actually just about to email you to ask what that INFO is for :) > What does it do? > It makes the section non-allocatable, so it is dropped from the final image > > > > .got.plt (INFO) : { *(.got.plt) } > > ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, ".got.plt not empty") > > > > Otherwise, yes, looks good. > > > > Reviewed-by: Kees Cook > > > > > + > > > .data : { > > > _data = . ; > > > *(.data) > > > @@ -77,3 +80,9 @@ SECTIONS > > > > > > DISCARDS > > > } > > > + > > > +#ifdef CONFIG_X86_64 > > > +ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT entries detected!") > > > +#else > > > +ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0xc, "Unexpected GOT/PLT entries detected!") > > > +#endif > > > -- > > > 2.26.2 > > > > > > > -- > > Kees Cook