This is a note to let you know that I've just added the patch titled bpf: Fix BTF_ID symbol generation collision to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bpf-fix-btf_id-symbol-generation-collision.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 8f908db77782630c45ba29dac35c434b5ce0b730 Mon Sep 17 00:00:00 2001 From: Jiri Olsa <jolsa@xxxxxxxxxx> Date: Fri, 15 Sep 2023 10:34:27 -0700 Subject: bpf: Fix BTF_ID symbol generation collision From: Jiri Olsa <jolsa@xxxxxxxxxx> commit 8f908db77782630c45ba29dac35c434b5ce0b730 upstream. 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 <inline asm>: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 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@xxxxxxxxxxxxxxx Reported-by: Satya Durga Srinivasu Prabhala <quic_satyap@xxxxxxxxxxx> Reported-by: Marcus Seyfarth <m.seyfarth@xxxxxxxxx> Closes: https://github.com/ClangBuiltLinux/linux/issues/1913 Debugged-by: Nathan Chancellor <nathan@xxxxxxxxxx> Link: https://lore.kernel.org/bpf/CAEf4Bzb5KQ2_LmhN769ifMeSJaWfebccUasQOfQKaOd0nQ51tw@xxxxxxxxxxxxxx/ Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx> Signed-off-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx> Link: https://lore.kernel.org/r/20230915-bpf_collision-v3-1-263fc519c21f@xxxxxxxxxx Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- include/linux/btf_ids.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/btf_ids.h +++ b/include/linux/btf_ids.h @@ -38,7 +38,7 @@ asm( \ ____BTF_ID(symbol) #define __ID(prefix) \ - __PASTE(prefix, __COUNTER__) + __PASTE(__PASTE(prefix, __COUNTER__), __LINE__) /* * The BTF_ID defines unique symbol for each ID pointing Patches currently in stable-queue which might be from jolsa@xxxxxxxxxx are queue-5.10/perf-jevents-switch-build-to-use-jevents.py.patch queue-5.10/perf-build-update-build-rule-for-generated-files.patch queue-5.10/bpf-fix-btf_id-symbol-generation-collision.patch queue-5.10/perf-build-define-yynomem-as-yynoabort-for-bison-3.8.patch queue-5.10/bpf-fix-btf_id-symbol-generation-collision-in-tools.patch queue-5.10/perf-metric-return-early-if-no-cpu-pmu-table-exists.patch