Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4831666rdb; Fri, 15 Sep 2023 13:48:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+bTAXEkCLv2ICEbYsE/jTMh3qAQcsBeh5ACgWrnCNO8dPwKkfH9uvffH/LajudspdE62C X-Received: by 2002:a05:6358:e49b:b0:142:efa1:cd33 with SMTP id by27-20020a056358e49b00b00142efa1cd33mr3007067rwb.6.1694810924894; Fri, 15 Sep 2023 13:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694810924; cv=none; d=google.com; s=arc-20160816; b=M3qohO/ZqUYK/K2ZZjdUBj6lHKdxI2aecExoNi0i6XiofE/wLyoEBuv1eZhAIC+rRP +MwHmPzMdbJOq7erg+4tOlC3j/ANm2t/SFvZrMIssNJboStfTxio1rLxEE8cG/4pjMG8 5WLrdRP7IVKuQdJsRIluwb6ydcedFVRYVgAsLNTBx5++5GR6S6f540t/oxtV++z5gYkY lt1hpbMbY9X/5TviDwxXAn52/vIWHL6+g34Uziqrn/fzNn0e4sxjyf9Rkg0aiH8BCNGk 28yhL7mbjXNaTXBKFm31gm6fR6qqXyF0hNYH9D1w9B9wMZJew27w0YDe/TtDNffVv6Gn LvDg== 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=toHSI7NrOZgvx0uzvA9KNtopi40O1OvJSkD1oOvtykg=; fh=Fp1oE4uagaejoDpWJB8TCDZhlqsRG5ivS4PSXdzWRgM=; b=p9EOq8V7XUZvAEnKUc0iImQkDEXmfY6RwbLzErmmbSjmjeonzzjdZlKrzbUwnIe3YE 2BytZlVWaZlfqjW4i+hS/e93r+7q3CB1coAjkXlL0T5J0oiqX04sv4ikQO2SpAxLeg8H hD3fiAKyx1g8DHu4ADLuqBa7F29sLck4nQKyoqBr9mx8Uk7mhhqdMAPT6OwvDNAFINv0 VaSwgf4b7jMHBgJwMNVf602j/Y4v60WrVFIzfS2Fx3ZScDZZ5H9eUfrpt3x8XsP+UW8d zaVIsio8O0kf67e2pZd89MtckIQp+urDeUtu7PcP6+ybKlUUt6y1oMyurgVZdS/D2pmz g+xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=akl055b2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bs62-20020a632841000000b0057808b558cesi2751314pgb.124.2023.09.15.13.48.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 13:48:44 -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=@google.com header.s=20230601 header.b=akl055b2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id F2F8C804253A; Fri, 15 Sep 2023 10:25:22 -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 S235526AbjIORYw (ORCPT + 99 others); Fri, 15 Sep 2023 13:24:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235734AbjIORYW (ORCPT ); Fri, 15 Sep 2023 13:24:22 -0400 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8DBB1BD2 for ; Fri, 15 Sep 2023 10:24:13 -0700 (PDT) Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-76f08e302a1so154128585a.1 for ; Fri, 15 Sep 2023 10:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1694798653; x=1695403453; 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=toHSI7NrOZgvx0uzvA9KNtopi40O1OvJSkD1oOvtykg=; b=akl055b2yJA6KXRK4fYvi5V5+idBqAZL3RwcI70DuhN7nOrfBkFDh66D3+nGmDDcxD rVo9p/kMhh2iHlL9DI3A4ttqR9Tpy2AOuiYfWz5ncpy3mMXKCkgOMzCjJUm2S0MrtMjW fnHjJp7SMXrsWg+xmBH/deTnRRGb5yGwPufGk7CfiCadwjrzMJEglC5iNeYtUPHnZKGb zMJYxDO7ESDqyZa8RMcOolixcgVXoLFm/Uqh2XD8LWe03kW2Wjy/fCxVIzeOZmap4Mzy edLeJpaLlYNb2cWeZ5MHmCuMMBtJMIBHnqy+dL8iuhikbkgtlwrWQesYabmP5whlzjNu GziQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694798653; x=1695403453; 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=toHSI7NrOZgvx0uzvA9KNtopi40O1OvJSkD1oOvtykg=; b=IWcWmzaU6t4yLC1YSYK/nQtgJvh7l7fLMGbuhPZzdSCnM7NqXFzgKmgdfLYkzP48L9 kgyyU83/qCeKiK6IwR0CAFK6Db7feTlpPmMMjRdMRIWpuEXT128Z7CTTtTCUPr2UH2gd 3rOOrjiC+FWQTwhTlQcEwmPvS8o3LvaVWmOAz5GZ4NfV+exYrMvOka7w4InJITNqjHK3 c8lUcKJnCnaVjcm+F88TR2qNlRl358IwnV8sFHNz3TKD88tDJ1D9NsGlUutI5cTUNYa4 nD17d2SQgXtMW0xs8j6xkmeDDfSG0K8unMPcmsEUVppmCNjAd0dOsx0lMwrsYougL2UC nWog== X-Gm-Message-State: AOJu0Yyt9WGPL5Uqts0rKQ+RGKoHCtzm+Pw6O6MSaGJmiCEXGNmb5tjR 7npwe6OR4EXNnPI6p6aWeIYrKVpChvTaw6FWZfNcIA== X-Received: by 2002:a0c:d990:0:b0:64a:6858:f9fb with SMTP id y16-20020a0cd990000000b0064a6858f9fbmr2309178qvj.49.1694798652855; Fri, 15 Sep 2023 10:24: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: Nick Desaulniers Date: Fri, 15 Sep 2023 10:24:00 -0700 Message-ID: Subject: Re: [PATCH v2] bpf: Fix BTF_ID symbol generation collision To: Alexei Starovoitov 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=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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:25:23 -0700 (PDT) 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 same > > > 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__ happens= 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 i= s > > > not a complete fix, but it would help for now and meanwhile we can wo= rk > > > 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_LmhN769ifMeSJaWfebccUa= sQOfQKaOd0nQ51tw@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?) --=20 Thanks, ~Nick Desaulniers