Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4958446rdb; Fri, 15 Sep 2023 19:14:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqEjbGQFPjnCqGXm2XrnPh8rVo272cx5Pl2Mu6nflVtXVIKHq3VcgkmnNfYjzbC07HZfnR X-Received: by 2002:a17:902:e852:b0:1b9:e937:9763 with SMTP id t18-20020a170902e85200b001b9e9379763mr4044101plg.12.1694830447189; Fri, 15 Sep 2023 19:14:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694830447; cv=none; d=google.com; s=arc-20160816; b=Dy/HuEQzYT+g9GoTt2ctFtghD7Db1cOk44jJQjSIB/k+mJijH8XAzhg41uKXlyoLWg txrEUkhVYRz3lEEGyQT33j8vg8v9w0YeErhXhMxw6fMC7u6gG2+d1k0h7iMeLWrNOndA e7lEwH2G/Vb1og8w+WZlKoRs+A3JTMZWtOj2cUCJNgqAOZ7v6btHdSAZcDZRCVafWaZA miYkDWyJZ7BjxVKn8LLN/OQMD15H9sgYzi5g/oMb4ntEBRzdmAIj+z/MHQ2XpYMlaRDE r0oSZ1+P82Z0ZEGiUowsyWzmo3QZyGhX92FsmjXH1jS2/54hCKTggjfdE2K4yLUa2GRO APUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=o1ARKux85tGtkjmvv+aJvZ+7Wjuleao2EehnwO/y7bE=; fh=KJCFTPnxDWvSTzgKcqVmtZW2dygkJsra448S7PFmyOA=; b=G641dIc6eTA6qDzO4nAF6F9RluSZN5DkPMDawOcxZOG07XAHIoovaIBR/MwHvosjfv BHCMmIpdZZE11G1DqiMYtELjVA3pSA/91bIR0udxUVjDeANyQBIDErqT2YIuagsqali2 +FJOny1uUNh/F5Gwbw9yl95XAF282XOhBITia+AuYj6mw9exv99bqZcidNwsZlfsg5gR Oyyf/zCfwLL1/TRAGCW1WkUxx2duVfNb/w8TxwSzUYC1jnaO8bUdJdcNThG2tKThfCMi 0Jgs3Sq4tjhOC7XxSMotucO+G0x4+VXkO5ZSkBRQ3My/zAftDrRcPSr5ufwMOIPfqq6j faoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="VnSqs/ha"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id e15-20020a17090301cf00b001c3a05b0b67si4383035plh.566.2023.09.15.19.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 19:14:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="VnSqs/ha"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C7B5F824BAE6; Fri, 15 Sep 2023 10:28:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235406AbjIOR1b (ORCPT + 99 others); Fri, 15 Sep 2023 13:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235499AbjIOR1T (ORCPT ); Fri, 15 Sep 2023 13:27:19 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CA68CF1; Fri, 15 Sep 2023 10:27:14 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-5009d4a4897so4061217e87.0; Fri, 15 Sep 2023 10:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694798833; x=1695403633; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o1ARKux85tGtkjmvv+aJvZ+7Wjuleao2EehnwO/y7bE=; b=VnSqs/haG/Rf+17GxL+OYPmpZztP7qFkt1zmqeOVwVlK9IzTQdYvxieMJnxJCPFhEc uqcyI0ZYB9k8hBZG/+cO4PPdDEnCnhl3R1OKTkWPmcU9FUVazs06v+z/KqsPWEFB1e9r h4ydsiLE6b/OMk43lHJFDgXz6SVztYCcrb2UlCczgfk8p7fDitoZMns6zxjKMXd70++w +8gILR5fw7mCGQLRL5HrIjvnMyJhGb1Fvv9C2BV3EMxsnv16A9iAunMJ/V9iRw8xYmC5 4wITuMVjtyKvNKETypYK31APEJBlF2qJRgoZcsETh/+6kG7m9YiCa+Qx01bWgbCQBKRF eTjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694798833; x=1695403633; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o1ARKux85tGtkjmvv+aJvZ+7Wjuleao2EehnwO/y7bE=; b=WRp/W8o3nfjyPNqkRYexM9eQLn8PpK8Lw+tkj5MXrzShEEh2Q5+RFroZ50Gj++6+Kw R3XILWtiwwqKH7TIwNvwlMu1w3LjQ+HygEpi+/9qwWbv8+2xL7PlMP2P386QGnL2N6ZR cPLOj/dpTg28M4Z8s1PwGJFQ1EE6g254YaVWnuLEvGNCReJeQstPphTG+Hon/N6uoTcN GpbARNMPIU2FAPc4iyWxR3g0DQ2JDaCv+FDmzHOimz1ndT8ttAzRCRWWN+V7huVmKTqh 2ZU5z89Engo0ReM3mrPpf8Pi8gF9VZTCh5Pay2m7lZHfmfq2yTuPMLXWrYeliRwy4XhZ rAaA== X-Gm-Message-State: AOJu0YwrtMa4O9ye+sC1QRV56k7LSjV5AQxvC+k3USpa+M6LyE/xKxX+ Q4jYtH5Xzl5luhJngczrE8JCJ7fsvHFbRIlsOYM= X-Received: by 2002:a19:5042:0:b0:500:bffa:5b86 with SMTP id z2-20020a195042000000b00500bffa5b86mr1873892lfj.6.1694798832457; Fri, 15 Sep 2023 10:27:12 -0700 (PDT) MIME-Version: 1.0 References: <20230915-bpf_collision-v2-1-027670d38bdf@google.com> <20230915171814.GA1721473@dev-arch.thelio-3990X> In-Reply-To: From: Alexei Starovoitov Date: Fri, 15 Sep 2023 10:27:01 -0700 Message-ID: Subject: Re: [PATCH v2] bpf: Fix BTF_ID symbol generation collision To: Nick Desaulniers Cc: Nathan Chancellor , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , LKML , bpf , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , stable , Satya Durga Srinivasu Prabhala , Marcus Seyfarth , Jiri Olsa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 15 Sep 2023 10:28:12 -0700 (PDT) On Fri, Sep 15, 2023 at 10:24=E2=80=AFAM Nick Desaulniers wrote: > > On Fri, Sep 15, 2023 at 10:22=E2=80=AFAM Alexei Starovoitov > wrote: > > > > On Fri, Sep 15, 2023 at 10:18=E2=80=AFAM Nathan Chancellor wrote: > > > > > > On Fri, Sep 15, 2023 at 09:42:20AM -0700, Nick Desaulniers wrote: > > > > Marcus and Satya reported an issue where BTF_ID macro generates sam= e > > > > symbol in separate objects and that breaks final vmlinux link. > > > > > > > > ld.lld: error: ld-temp.o :14577:1: symbol > > > > '__BTF_ID__struct__cgroup__624' is already defined > > > > > > > > This can be triggered under specific configs when __COUNTER__ happe= ns to > > > > be the same for the same symbol in two different translation units, > > > > which is already quite unlikely to happen. > > > > > > > > Add __LINE__ number suffix to make BTF_ID symbol more unique, which= is > > > > not a complete fix, but it would help for now and meanwhile we can = work > > > > on better solution as suggested by Andrii. > > > > > > > > Cc: stable@vger.kernel.org > > > > Reported-by: Satya Durga Srinivasu Prabhala > > > > Reported-by: Marcus Seyfarth > > > > Closes: https://github.com/ClangBuiltLinux/linux/issues/1913 > > > > Tested-by: Marcus Seyfarth > > > > Debugged-by: Nathan Chancellor > > > > Co-developed-by: Jiri Olsa > > > > Link: https://lore.kernel.org/bpf/CAEf4Bzb5KQ2_LmhN769ifMeSJaWfebcc= UasQOfQKaOd0nQ51tw@mail.gmail.com/ > > > > Signed-off-by: Nick Desaulniers > > > > --- > > > > tools/include/linux/btf_ids.h | 2 +- > > > > > > Shouldn't this diff be in include/linux/btf_ids.h as well? Otherwise,= I > > > don't think it will be used by the kernel build. > > D'oh! > > > > > argh. > > Let's do this patch as-is and another patch to update everything > > in tools/../btf_ids.h, since it got out of sync quite a bit. > > I think I can do both in a v3? I don't see the issue (in mainline, are > they out of sync in -next?) Yes. Pls send v3 with two patches. We'll apply and flush bpf trees, so both will have all fixes in a day or so= .