linux-stable/tools
Nick Desaulniers 4fb56e82d9 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 14:57:04 +02:00
..
accounting
arch x86/bugs: Increase the x86 bugs vector size to two u32s 2023-08-08 20:03:50 +02:00
bootconfig
bpf bpftool: Use a local bpf_perf_event_value to fix accessing its fields 2023-09-13 09:42:30 +02:00
build
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio tools: gpio: fix debounce_period_us output of lsgpio 2023-06-21 16:00:52 +02:00
hv vmbus_testing: fix wrong python syntax for integer value comparison 2023-09-13 09:42:23 +02:00
iio tools: iio: iio_generic_buffer: Fix some integer type and calculation 2023-09-23 11:11:07 +02:00
include bpf: Fix BTF_ID symbol generation collision in tools/ 2023-10-06 14:57:04 +02:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Free btf_vmlinux when closing bpf_object 2023-09-23 11:11:03 +02:00
memory-model
objtool objtool/x86: Fix SRSO mess 2023-08-27 21:01:31 +02:00
pci
pcmcia
perf perf build: Define YYNOMEM as YYNOABORT for bison < 3.81 2023-10-06 14:56:58 +02:00
power cpupower: Make TSC read per CPU for Mperf monitor 2023-05-24 17:32:43 +01:00
rcu
scripts
spi
testing memblock tests: fix warning ‘struct seq_file’ declared inside parameter list 2023-10-06 14:56:56 +02:00
thermal
time
tracing
usb
verification
virtio
vm
wmi
Makefile