Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp663371pxx; Wed, 28 Oct 2020 13:48:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4tq2Il0YHixvxdyapogGEf6k0lHRBxdSox0XdqhegIXLeuMknPXLSGpJXqs3wngCv2J+d X-Received: by 2002:a50:a6d0:: with SMTP id f16mr733866edc.135.1603918120695; Wed, 28 Oct 2020 13:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603918120; cv=none; d=google.com; s=arc-20160816; b=i/X7Wseh8viPuKMcuJ/OpckCr55e8vQMt4+KI+XXw2UoPlTFGcC3k8dDd8xbW1Iabb ENqKlB1NcvlhVpTJTwioxwOz6NZLRGidqh1dLz7Shs469n+qO7cB9E/Nd9rdA5n+sH1v zWM0kr0G5wqJoZ/53tF/mKmZO/G+7AbAFxxzKt2iR9GiRVss2CGSCGp6fs3spAkyKYxO ZVqLlJDkHTv0J3VunwQqf/HtTHHEaJh9Kg+vMhGpwegHJBqtsyIL2bLkGRS28fDmiYTS NFBGTgMdbvFlMMZQe8cECRmsd/79adsaW6ctB3MWnnlE0rUTkNp/9Dkybb6A7JZ0Tbha UZQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=DAXcDu1i1flhyWT9SP7kPy0qFQN/al6f7WHErrrSgPg=; b=GIVlAkPEPhToFLh0MfC0tw6W0qF+ZozLqWIS69YgZqHsAmWb1fSAJcFrj1CabMb2Sn VRrY+oxCjFQvFjJl94SFEIH3H7j7NOWRlQBetaoNj22PD2RfxXEKy/cVhOpwOi0I51By zX1k2Gix/iJoU9aQdhZPNguJTLT5QyRYuSD/z3KRgQd2Fljn82I6wRYiKsLVLXkL0AO8 T/QqcQWhWAQhs0vWu6FZu/LSY7UwyVGFPMBIVHAbxoI5v7cvMAm7fLFGiJy4ZIgjS8sP 943CSEtQKYjMRwiECt5MTb5b9SmQ8kvxg0TQFtFMkMKP5XZE92vE2/HhuXLg+Z1Qnsct Kb/A== ARC-Authentication-Results: i=1; mx.google.com; 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 i14si21419edl.282.2020.10.28.13.48.18; Wed, 28 Oct 2020 13:48:40 -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; 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 S1829923AbgJ0TZ6 (ORCPT + 99 others); Tue, 27 Oct 2020 15:25:58 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:35829 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S371994AbgJ0TZk (ORCPT ); Tue, 27 Oct 2020 15:25:40 -0400 Received: by mail-ot1-f65.google.com with SMTP id n11so2177331ota.2; Tue, 27 Oct 2020 12:25:38 -0700 (PDT) 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:from:date :message-id:subject:to:cc; bh=DAXcDu1i1flhyWT9SP7kPy0qFQN/al6f7WHErrrSgPg=; b=rcEDJP/LP0s6ReH2dyIErjyTHQEVDop33QaD877pbPDmYIngX4QeZLsdJ6NMjDi5dF 0z52TfweQj3Tt2GLdZiF5rI4+sKQl6uVcyZMRIRq1j5g3Tb6UtE+QJOh5V21cvoHw9q6 M39+WbHVIqmGP72pYglhIUeLqLOZBq3lL8RezCl4E+Hz1Qz27B/ExhpaCP6glX1dIW0z f2wDHo8xVGC6O8wTVl8ArZiiZC+/c6jix5n3hAMAqoZNzGIR5EapEeu6UZQRfbFMPhiv u8kxSBYh9Z6fXiHyixJVcb5ZvkzzVYaWKu4xLbfUUQiiS9zZMUWwMDB23+f1y5W6uiks xhqg== X-Gm-Message-State: AOAM530Pa4xzAoiQNimF3wkxLy+pYBquYxffGW/j17Q2kmIi+1YNdHA6 ackNelP6QhTM/1K+FEeKWvZQ0hOli0ZiQlPsStQ= X-Received: by 2002:a9d:5e14:: with SMTP id d20mr2427991oti.107.1603826738174; Tue, 27 Oct 2020 12:25:38 -0700 (PDT) MIME-Version: 1.0 References: <20200821194310.3089815-1-keescook@chromium.org> <20200821194310.3089815-14-keescook@chromium.org> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 27 Oct 2020 20:25:26 +0100 Message-ID: Subject: Re: [PATCH v6 13/29] arm64/build: Assert for unwanted sections To: Nick Desaulniers Cc: Ard Biesheuvel , Kees Cook , Ingo Molnar , Catalin Marinas , Mark Rutland , Peter Collingbourne , James Morse , Borislav Petkov , Ingo Molnar , Russell King , Masahiro Yamada , Arvind Sankar , Nathan Chancellor , Arnd Bergmann , "the arch/x86 maintainers" , clang-built-linux , Linux-Arch , linux-efi , Linux ARM , Linux Kernel Mailing List , Linux-Renesas , Josh Poimboeuf Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nick, CC Josh On Mon, Oct 26, 2020 at 6:49 PM Nick Desaulniers wrote: > On Mon, Oct 26, 2020 at 10:44 AM Geert Uytterhoeven > wrote: > > On Mon, Oct 26, 2020 at 6:39 PM Ard Biesheuvel wrote: > > > On Mon, 26 Oct 2020 at 17:01, Geert Uytterhoeven wrote: > > > > On Mon, Oct 26, 2020 at 2:29 PM Geert Uytterhoeven wrote: > > > > > On Mon, Oct 26, 2020 at 1:29 PM Geert Uytterhoeven wrote: > > > > > > On Fri, Aug 21, 2020 at 9:56 PM Kees Cook wrote: > > > > > > > In preparation for warning on orphan sections, discard > > > > > > > unwanted non-zero-sized generated sections, and enforce other > > > > > > > expected-to-be-zero-sized sections (since discarding them might hide > > > > > > > problems with them suddenly gaining unexpected entries). > > > > > > > > > > > > > > Suggested-by: Ard Biesheuvel > > > > > > > Signed-off-by: Kees Cook > > > > > > > > > > > > This is now commit be2881824ae9eb92 ("arm64/build: Assert for unwanted > > > > > > sections") in v5.10-rc1, and is causing the following error with > > > > > > renesas_defconfig[1]: > > > > > > > > > > > > aarch64-linux-gnu-ld: warning: orphan section `.eh_frame' from > > > > > > `kernel/bpf/core.o' being placed in section `.eh_frame' > > > > > > aarch64-linux-gnu-ld: Unexpected GOT/PLT entries detected! > > > > > > aarch64-linux-gnu-ld: Unexpected run-time procedure linkages detected! > > > > > > > > > > > > I cannot reproduce this with the standard arm64 defconfig. > > > > > > > > > > > > I bisected the error to the aforementioned commit, but understand this > > > > > > is not the real reason. If I revert this commit, I still get: > > > > > > > > > > > > aarch64-linux-gnu-ld: warning: orphan section `.got.plt' from > > > > > > `arch/arm64/kernel/head.o' being placed in section `.got.plt' > > > > > > aarch64-linux-gnu-ld: warning: orphan section `.plt' from > > > > > > `arch/arm64/kernel/head.o' being placed in section `.plt' > > > > > > aarch64-linux-gnu-ld: warning: orphan section `.data.rel.ro' from > > > > > > `arch/arm64/kernel/head.o' being placed in section `.data.rel.ro' > > > > > > aarch64-linux-gnu-ld: warning: orphan section `.eh_frame' from > > > > > > `kernel/bpf/core.o' being placed in section `.eh_frame' > > > > > > > > > > > > I.e. including the ".eh_frame" warning. I have tried bisecting that > > > > > > warning (i.e. with be2881824ae9eb92 reverted), but that leads me to > > > > > > commit b3e5d80d0c48c0cc ("arm64/build: Warn on orphan section > > > > > > placement"), which is another red herring. > > > > > > > > > > kernel/bpf/core.o is the only file containing an eh_frame section, > > > > > causing the warning. > > When I see .eh_frame, I think -fno-asynchronous-unwind-tables is > missing from someone's KBUILD_CFLAGS. > But I don't see anything curious in kernel/bpf/Makefile, unless > cc-disable-warning is somehow broken. I tracked it down to kernel/bpf/core.c:___bpf_prog_run() being tagged with __no_fgcse aka __attribute__((optimize("-fno-gcse"))). Even if the function is trivially empty ("return 0;"), a ".eh_frame" section is generated. Removing the __no_fgcse tag fixes that. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds