WSL2-Linux-Kernel/tools/include/linux
Nick Desaulniers 132a5ae413 bpf: Fix BTF_ID symbol generation collision in tools/
commit c0bb9fb0e5 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@vger.kernel.org
Reported-by: Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>
Reported-by: Marcus Seyfarth <m.seyfarth@gmail.com>
Closes: https://github.com/ClangBuiltLinux/linux/issues/1913
Debugged-by: Nathan Chancellor <nathan@kernel.org>
Co-developed-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/CAEf4Bzb5KQ2_LmhN769ifMeSJaWfebccUasQOfQKaOd0nQ51tw@mail.gmail.com/
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20230915-bpf_collision-v3-2-263fc519c21f@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-06 13:18:23 +02:00
..
sched
unaligned
atomic.h
bitmap.h tools: rename bitmap_alloc() to bitmap_zalloc() 2021-09-08 11:50:27 -07:00
bitops.h bitops: more BITS_TO_* macros 2020-02-04 03:05:26 +00:00
bits.h linux/bits.h: fix compilation error with GENMASK 2021-05-22 15:09:07 -10:00
btf_ids.h bpf: Fix BTF_ID symbol generation collision in tools/ 2023-10-06 13:18:23 +02:00
bug.h
build_bug.h tools headers: Syncronize linux/build_bug.h with the kernel sources 2021-01-15 16:31:46 -03:00
compiler-gcc.h tools: compiler-gcc.h: Guard error attribute use with __has_attribute 2021-09-13 15:51:41 -07:00
compiler.h tools headers: Get tools's linux/compiler.h closer to the kernel's 2020-12-18 17:32:26 -03:00
compiler_types.h tools: Add sparse context/locking annotations in compiler-types.h 2021-08-19 15:39:22 -03:00
const.h linux/bits.h: fix compilation error with GENMASK 2021-05-22 15:09:07 -10:00
coresight-pmu.h tools headers UAPI: Update tools' copy of linux/coresight-pmu.h 2021-03-06 16:54:30 -03:00
ctype.h tools headers: Update linux/ctype.h with the kernel sources 2020-12-18 17:32:28 -03:00
debug_locks.h
delay.h
err.h docs: fix broken documentation links 2019-06-08 13:42:13 -06:00
export.h module: remove EXPORT_UNUSED_SYMBOL* 2021-02-08 12:28:07 +01:00
filter.h bpf: Add bitwise atomic instructions 2021-01-14 18:34:29 -08:00
ftrace.h
gfp.h
hardirq.h
hash.h
hashtable.h
interrupt.h
irqflags.h lockdep: Remove lockdep_hardirq{s_enabled,_context}() argument 2020-07-10 12:00:02 +02:00
jhash.h tools/: replace HTTP links with HTTPS ones 2020-08-07 11:33:21 -07:00
kallsyms.h kallsyms/printk: add loglvl to print_ip_sym() 2020-06-09 09:39:10 -07:00
kconfig.h tools headers: Remove broken definition of __LITTLE_ENDIAN 2021-07-14 14:39:36 -03:00
kern_levels.h
kernel.h tools: fix ARRAY_SIZE defines in tools and selftests hdrs 2023-02-06 07:59:01 +01:00
linkage.h
list.h
lockdep.h
log2.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
math64.h tools include: Add an initial math64.h 2021-04-15 16:38:02 -03:00
module.h
mutex.h
nmi.h
numa.h
objtool.h x86/ibt: Add ANNOTATE_NOENDBR 2023-08-26 14:23:39 +02:00
overflow.h compiler.h: drop fallback overflow checkers 2021-09-13 10:18:28 -07:00
poison.h mm, page_poison: remove CONFIG_PAGE_POISONING_ZERO 2020-12-15 12:13:46 -08:00
proc_fs.h
rbtree.h rbtree: Add generic add and find helpers 2021-02-17 14:07:31 +01:00
rbtree_augmented.h docs: Add rbtree documentation to the core-api 2020-04-21 10:29:19 -06:00
rcu.h rcu: Don't return a value from rcu_assign_pointer() 2019-06-13 15:38:34 -07:00
refcount.h
ring_buffer.h tools headers: Add missing perf_event.h include 2019-08-22 11:12:36 -03:00
seq_file.h
sizes.h tools: bpftool: add "prog run" subcommand to test-run programs 2019-07-05 23:48:07 +02:00
spinlock.h
stacktrace.h
static_call_types.h static_call: Move struct static_call_key definition to static_call_types.h 2021-03-11 16:04:39 +01:00
string.h tools lib: Adopt memchr_inv() from kernel 2020-11-27 08:34:52 -03:00
stringify.h
time64.h
types.h tools include: Add __sum16 and __wsum definitions. 2021-03-08 10:42:03 -03:00
zalloc.h tools lib: Adopt zalloc()/zfree() from tools/perf 2019-07-09 10:13:26 -03:00