Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2975467ybt; Mon, 29 Jun 2020 11:55:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyr5SCZu8PRby1BbrDWzUOIoKdUE3/4rVL1IfKq9VY4CuF6UG56bNK3C3e5+evirwDwiBxN X-Received: by 2002:a17:906:e25a:: with SMTP id gq26mr14762142ejb.152.1593456914506; Mon, 29 Jun 2020 11:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593456914; cv=none; d=google.com; s=arc-20160816; b=QzCB2p515vQgm+o1xHv9q94ERjczt+ITLv6ynJ/BKgaQF10Nj84fKaBEE0nEtqMr0M qKbT9difEcDsigSjKG3DOkvZNAlrJ1il7H2AdvHzNAtdked0WNYXRSKbnhrYc8Qn9WD8 udC/DivSqSPsayWlJsJfKomSSpaoL/QS10/m9ScxTxGGtUTDMP5utBGXpnk/3fGabIa3 /bOZkX9FV5uNM+sejzAZMvTtLtAIy/M18D6oollF17DqWfYiEhxBILlXPb6UbKH38uL4 Aim2TmIXnhgAw23faJCg1GbBorXRRU6sB/q3b775Fhk+byseRoFBfyV6rPGRotJYL40h qVZQ== 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=ksn6KEgSSy4O04+EmiHmLNcv0njEAGgzFW6T11ji+vI=; b=eD8+SWrABm8CnVUTV+ASY56iKh4FuXrjf/1FkXEi6Pd3iijXBtFco+7GQ5mlw2hXr/ MXxk3KOImU6VIjY1BvyCS4o+pE3LKjdhZsO1BY+rjYWgR23S7izDOANx5UN0TcbEpzAE ytSUM5rqjb+7Z7rpm0U6SlPdg7VpU/G7gU7hSSY5PRtf/ekUriIO7yAUdR7WJ28IbEc5 foW0/Jr84KFwbYhAupaDfF1bTkTxwV4YSXHvRrgB6cs6sdgHW4pKfavBrEt+8IkzvjOk 2nUVuLJLIuzFG+7/Xc0iBhu9s/ZSKPyd9YgztbwxlH3WAD0+NsQWFPCqikWHnJVh0CRe 6Meg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="Xjvp/Ruc"; 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 dt4si369136ejc.34.2020.06.29.11.54.50; Mon, 29 Jun 2020 11:55:14 -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="Xjvp/Ruc"; 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 S1726076AbgF2Syp (ORCPT + 99 others); Mon, 29 Jun 2020 14:54:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729807AbgF2Sww (ORCPT ); Mon, 29 Jun 2020 14:52:52 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C9B7C031C7A; Mon, 29 Jun 2020 11:15:17 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id z2so13590859qts.5; Mon, 29 Jun 2020 11:15:17 -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=ksn6KEgSSy4O04+EmiHmLNcv0njEAGgzFW6T11ji+vI=; b=Xjvp/RucTJD7ys4so77HqyBdKQg72774rOpK0Iy63xJF5nLNOOILQoRIXkvOl8GSiV +dq1LOTSqRzP649aH77rs+eXXLE6NrmWrR2ZfZCPcZIIXq+sCkRejxszABRcdazkcaLO sosTZdgioDe0Awvmhn8VQ9Xq7tdlEZdqFPTfi0ICfdG4ZOw15yRKYNYyr7GlNnUU/Jc6 j+yXaf+nXfjR9kDYWQi3iHL2zZJ08F13kaTJcXndLsH6fIgDkpVttULkAJxaKMU4AZTG otU+pDZSB+sDNIHb74V0Qlsb3g2ppZAYET8gjxxd9JFf9PRwuZVBIXjVJQHbrkmo8MjZ lAEw== 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=ksn6KEgSSy4O04+EmiHmLNcv0njEAGgzFW6T11ji+vI=; b=MMCFgfFy9XnVzlCnOmLXySRIJgDwwaAj3tfCJEP31d9kQcaS9N9s1aLPJeQJhQvxE+ 3SRMx35eiwg5VzdZH60FFBN5CbgZ5KcZobnftXPg3HbGkyoznqcd8lp5p9RThLhLr01h 3NzspdNOa9bTIjExPT0NysjWKc/fTEqr4DWl0stTG7/Z9aV3cFLQbHgE09rj0NfZ1kEs naM2suTJS37VlRM7S8QUsUj2uBFy34PjijFIkeyC29bKWJepv99TJC/rpbV2t64K88ua q0uLpEwwqJ/QsgY/vak953jOQ9hJpK938DYmqNY+9YigJtuZQsEl9V90RUuhxKPl8ToV MhBw== X-Gm-Message-State: AOAM532ECWZ/23VgLyHR8ClfLpqlvHPq6zguAWeTv/2/v5t3pFttUnoH +P6Lp7caVaj2RH1UsbMqys0= X-Received: by 2002:ac8:7242:: with SMTP id l2mr16374761qtp.320.1593454516576; Mon, 29 Jun 2020 11:15:16 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id z17sm592545qth.24.2020.06.29.11.15.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 11:15:16 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Mon, 29 Jun 2020 14:15:14 -0400 To: Russell King - ARM Linux admin Cc: Arvind Sankar , Kees Cook , Will Deacon , Catalin Marinas , Mark Rutland , Ard Biesheuvel , Peter Collingbourne , James Morse , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Masahiro Yamada , Nick Desaulniers , Nathan Chancellor , Arnd Bergmann , x86@kernel.org, clang-built-linux@googlegroups.com, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 14/17] arm/build: Warn on orphan section placement Message-ID: <20200629181514.GA1046442@rani.riverdale.lan> References: <20200629061840.4065483-1-keescook@chromium.org> <20200629061840.4065483-15-keescook@chromium.org> <20200629155401.GB900899@rani.riverdale.lan> <20200629180703.GX1551@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200629180703.GX1551@shell.armlinux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 07:07:04PM +0100, Russell King - ARM Linux admin wrote: > On Mon, Jun 29, 2020 at 11:54:01AM -0400, Arvind Sankar wrote: > > On Sun, Jun 28, 2020 at 11:18:37PM -0700, Kees Cook wrote: > > > We don't want to depend on the linker's orphan section placement > > > heuristics as these can vary between linkers, and may change between > > > versions. All sections need to be explicitly named in the linker > > > script. > > > > > > Specifically, this would have made a recently fixed bug very obvious: > > > > > > ld: warning: orphan section `.fixup' from `arch/arm/lib/copy_from_user.o' being placed in section `.fixup' > > > > > > Discard unneeded sections .iplt, .rel.iplt, .igot.plt, and .modinfo. > > > > > > Add missing text stub sections .vfp11_veneer and .v4_bx. > > > > > > Add debug sections explicitly. > > > > > > Finally enable orphan section warning. > > > > This is unrelated to this patch as such, but I noticed that ARM32/64 places > > the .got section inside .text -- is that expected on ARM? > > Do you mean in general, in the kernel vmlinux, in the decompressor > vmlinux or ... ? > Sorry, in the kernel vmlinux. ARM_TEXT includes *(.got) for 32-bit, and the 64-bit vmlinux.lds.S includes it in .text as well. The decompressor for 32-bit keeps it separate for non-EFI stub kernel and puts it inside .data for EFI stub.