Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4960834rdb; Fri, 15 Sep 2023 19:22:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH1p7DAWLh/8bxG3qKcdS/zM4wjq7q9NqDgkN8SCGL4UapFrVMH5sAXICc/20nIbFt+Gpua X-Received: by 2002:a05:6a00:1d11:b0:68a:6cbe:35a7 with SMTP id a17-20020a056a001d1100b0068a6cbe35a7mr3761516pfx.2.1694830923156; Fri, 15 Sep 2023 19:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694830923; cv=none; d=google.com; s=arc-20160816; b=nzEqiBDmjJY4Od5c8rIiQqPI6T9A19iEExVjz1RBTUqEgo/7cQ4TntbCKsPYApOSQj 66toODjDrC3jK8CQ/RsZoRjt3ip9cIrffcIQBoKDv/iFrV/8TUqGB1NwqMTAojs4ztt/ E2V/8CYrv5xdXNZoTs8HOwGC3B7/FG/sH+ydCVIH6NRmsnlOgnlhRANtI8W2JzKZKp/1 R/dmB/aUvBFZSWEKERSvc6LGxs4E38IW9Yeww3ZaLKoqUeBdtCfKx4NOd2fnjiPqfP8d 69xDOULwxvrA9+YBJ2wYLBLbWLKxEQaPKYDFO+GK4Wg696zHBw9jlsFDqJw/dUJhUIN7 zyGg== 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=hbTOfXLq+M53K/FMFDrbAZVv5Nn1wG1Cp/nYwUS1YQQ=; fh=KJCFTPnxDWvSTzgKcqVmtZW2dygkJsra448S7PFmyOA=; b=KS8hLBN0uAWIzC06JYh4Wio1sZEnG/2kD0tvuz5Ik9TyerWPHahcfoPZcOhH8kCOW6 c//UNcXXnBqIawvApqR1Wk35LDIJgCKVti+JBGFQedPsDKNUb2TVMH7E1spnMfyiYraA PLc5wSpHLanjvbgjiXYJMSmGrl8F0g0oEwT5Qqf02rRSGY2GRsTPO3ZH0KMMboMgPvCi eGW3C3wmaqdvyyH52G1wnbuDM6gYQtqZRGqXjPn6C+9hUiIJhYG9bEnBtu8bfe3hvvUm AbIyZbXz3qdxzOFp0CZeCUEbUEnf+TyT+N4wQtM22R0g4SzMkDYTq4f+cKv25O+1T5ka Zt1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="adXUD0/e"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ch11-20020a056a00288b00b00690208f6d56si4156952pfb.340.2023.09.15.19.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 19:22:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="adXUD0/e"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 0F51382DCAA2; Fri, 15 Sep 2023 10:29:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235842AbjIOR3I (ORCPT + 99 others); Fri, 15 Sep 2023 13:29:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235902AbjIOR2v (ORCPT ); Fri, 15 Sep 2023 13:28:51 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1C181BF2; Fri, 15 Sep 2023 10:28:45 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5029e4bfa22so3962797e87.3; Fri, 15 Sep 2023 10:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694798924; x=1695403724; 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=hbTOfXLq+M53K/FMFDrbAZVv5Nn1wG1Cp/nYwUS1YQQ=; b=adXUD0/ezwYufaLXAnEGn67Y6KGfJJZd7/Je6xLDrDS83DswRA9jKBhnigcqigWZ/z OxhWPqWgOaPW/cnxVIIwmsJ/gm1L/e9D503gwv5EoeGFYmGAdq/c1cub4Qik0uaebldD fEkhuDrqXyye5Rs2tIJc7Sq3MScYmEyHyzd4ubE/D4pHguGYJi/dDoy6xaUQeeqtiJgE uAZyO7sYNEcwL4+VIqkrt5FZ5Vu66UaBHvaOpvt3wISjiRhT/dq6QkEzSiNF1VXbkjaZ STZPHZDyKu8zZgVGYs3iTBcshnPmb+nrWN7C2w+2KRLBBijrOGNO7t4RR92Tz6nmrvB9 gBHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694798924; x=1695403724; 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=hbTOfXLq+M53K/FMFDrbAZVv5Nn1wG1Cp/nYwUS1YQQ=; b=NhBHkUf7rYx8djJaanDWFDNGxZ2CwIiT1pkHzT8y/6ulah4zNRefvieLJnDIaKQ173 XwREGy9oXiWLChgviFbOa5kquWB29X5zcjdfE4QXR50VWhtIlQbC4wuT+MQfehftSAyV pGECKhOyrljmZT6aSFX3VqvYUPbC7Zk6xKvCAzEWqmj6VaWczbAwD3WjCvurMhKevG8V K/Z8bKmFJ1S4iGeZyReQs6Faf9QMd7DW6zu/mmGKfvn75S08zaftLvO5rdpPflVu23Dj I8scsqLOd6FOU0nybz+OASCjCot1a6YbPNalx1+KE1Ic4LY/XzJhTOm14Ib1ZSCjQ3Jk A7fQ== X-Gm-Message-State: AOJu0YxAhIaPXdkE54x7J8wgKXQ4WNBtKgzne3yJysASTTdimrPwCExE SBekRhyUcGP1wyf2jucJi4hxpBQuos/UoL2myA8= X-Received: by 2002:a05:6512:4004:b0:502:d743:9fd0 with SMTP id br4-20020a056512400400b00502d7439fd0mr2648065lfb.45.1694798923793; Fri, 15 Sep 2023 10:28:43 -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:28:32 -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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 15 Sep 2023 10:29:41 -0700 (PDT) On Fri, Sep 15, 2023 at 10:27=E2=80=AFAM Alexei Starovoitov wrote: > > 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 s= ame > > > > > 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__ hap= pens to > > > > > be the same for the same symbol in two different translation unit= s, > > > > > which is already quite unlikely to happen. > > > > > > > > > > Add __LINE__ number suffix to make BTF_ID symbol more unique, whi= ch is > > > > > not a complete fix, but it would help for now and meanwhile we ca= n 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_LmhN769ifMeSJaWfeb= ccUasQOfQKaOd0nQ51tw@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? Otherwis= e, 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. And please use [PATCH bpf v3] in subject, so that BPF CI can test it proper= ly.