linux-stable/kernel
Christophe Leroy 487d69e768 kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
[ Upstream commit 353e7300a1 ]

Activating KCSAN on a 32 bits architecture leads to the following
link-time failure:

    LD      .tmp_vmlinux.kallsyms1
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_load':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_load_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_store':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_store_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_exchange':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_exchange_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_add':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_add_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_sub':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_sub_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_and':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_and_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_or':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_or_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_xor':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_xor_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_fetch_nand':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_fetch_nand_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_strong':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_weak':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'
  powerpc64-linux-ld: kernel/kcsan/core.o: in function `__tsan_atomic64_compare_exchange_val':
  kernel/kcsan/core.c:1273: undefined reference to `__atomic_compare_exchange_8'

32 bits architectures don't have 64 bits atomic builtins. Only
include DEFINE_TSAN_ATOMIC_OPS(64) on 64 bits architectures.

Fixes: 0f8ad5f2e9 ("kcsan: Add support for atomic builtins")
Suggested-by: Marco Elver <elver@google.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Marco Elver <elver@google.com>
Acked-by: Marco Elver <elver@google.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/d9c6afc28d0855240171a4e0ad9ffcdb9d07fceb.1683892665.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-11 19:39:47 +02:00
..
bpf bpf: Fix memleak due to fentry attach failure 2023-07-11 19:39:27 +02:00
cgroup cgroup,freezer: hold cpu_hotplug_lock before freezer_mutex in freezer_css_{online,offline}() 2023-06-28 11:14:07 +02:00
configs
debug
dma swiotlb: fix debugfs reporting of reserved memory pools 2023-05-11 23:17:33 +09:00
entry entry/rcu: Check TIF_RESCHED _after_ delayed RCU wake-up 2023-03-21 15:13:15 +01:00
events perf/core: Fix perf_sample_data not properly initialized for different swevents in perf_tp_event() 2023-05-24 17:29:58 +01:00
futex - Prevent the leaking of a debug timer in futex_waitv() 2023-01-01 11:15:05 -08:00
gcov gcov: add support for checksum field 2022-12-21 14:31:52 -08:00
irq x86/pci/xen: populate MSI sysfs entries 2023-05-30 14:17:26 +01:00
kcsan kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures 2023-07-11 19:39:47 +02:00
livepatch Livepatching changes for 6.3 2023-02-23 14:00:10 -08:00
locking locking/rwsem: Add __always_inline annotation to __down_read_common() and inlined callers 2023-05-17 14:02:05 +02:00
module module/decompress: Fix error checking on zstd decompression 2023-06-09 10:48:18 +02:00
power PM: hibernate: Do not get block device exclusively in test_resume mode 2023-05-11 23:17:36 +09:00
printk printk changes for 6.3 2023-02-23 13:49:45 -08:00
rcu rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale 2023-07-11 19:39:25 +02:00
sched sched/core: Avoid multiple calling update_rq_clock() in __cfsb_csd_unthrottle() 2023-07-11 19:39:26 +02:00
time tick/rcu: Fix bogus ratelimit condition 2023-07-11 19:39:23 +02:00
trace bpf: Add extra path pointer check to d_path helper 2023-06-14 11:16:51 +02:00
.gitignore
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
Makefile kernel hardening fixes for v6.2-rc1 2022-12-23 12:00:24 -08:00
acct.c
async.c
audit.c
audit.h
audit_fsnotify.c
audit_tree.c
audit_watch.c
auditfilter.c
auditsc.c capability: just use a 'u64' instead of a 'u32[2]' array 2023-03-01 10:01:22 -08:00
backtracetest.c
bounds.c
capability.c capability: just use a 'u64' instead of a 'u32[2]' array 2023-03-01 10:01:22 -08:00
cfi.c
compat.c sched_getaffinity: don't assume 'cpumask_size()' is fully initialized 2023-03-14 19:32:38 -07:00
configs.c
context_tracking.c context_tracking: Fix noinstr vs KASAN 2023-01-13 11:48:18 +01:00
cpu.c
cpu_pm.c cpuidle, cpu_pm: Remove RCU fiddling from cpu_pm_{enter,exit}() 2023-01-13 11:48:15 +01:00
crash_core.c mm: remove 'First tail page' members from struct page 2023-02-02 22:32:59 -08:00
crash_dump.c
cred.c
delayacct.c
dma.c
exec_domain.c
exit.c arm64 updates for 6.3: 2023-02-21 15:27:48 -08:00
extable.c
fail_function.c kernel/fail_function: fix memory leak with using debugfs_lookup() 2023-02-08 13:36:22 +01:00
fork.c bpf: Fix UAF in task local storage 2023-06-14 11:16:44 +02:00
freezer.c
gen_kheaders.sh kheaders: use standard naming for the temporary directory 2023-01-22 23:43:34 +09:00
groups.c
hung_task.c hung_task: print message when hung_task_warnings gets down to zero. 2023-02-09 17:03:20 -08:00
iomem.c
irq_work.c
jump_label.c
kallsyms.c
kallsyms_internal.h
kallsyms_selftest.c kallsyms: Fix scheduling with interrupts disabled in self-test 2023-01-13 15:09:08 -08:00
kallsyms_selftest.h
kcmp.c
kcov.c mm: replace vma->vm_flags direct modifications with modifier calls 2023-02-09 16:51:39 -08:00
kexec.c kexec: introduce sysctl parameters kexec_load_limit_* 2023-02-02 22:50:05 -08:00
kexec_core.c kexec: fix a memory leak in crash_shrink_memory() 2023-07-11 19:39:29 +02:00
kexec_elf.c
kexec_file.c kexec: support purgatories with .text.hot sections 2023-06-21 16:02:09 +02:00
kexec_internal.h
kheaders.c kheaders: Use array declaration instead of char 2023-05-11 23:16:49 +09:00
kmod.c
kprobes.c x86/kprobes: Fix arch_check_optimized_kprobe check within optimized_kprobe range 2023-02-21 08:49:16 +09:00
ksysfs.c kernels/ksysfs.c: export kernel address bits 2023-01-20 14:30:45 +01:00
kthread.c kthread_worker: check all delayed works when destroy kthread worker 2023-02-02 22:50:02 -08:00
latencytop.c
module_signature.c
notifier.c kernel/notifier: Remove CONFIG_SRCU 2023-02-02 16:26:06 -08:00
nsproxy.c
padata.c Kbuild updates for v6.2 2022-12-19 12:33:32 -06:00
panic.c panic: fix the panic_print NMI backtrace setting 2023-03-02 21:54:23 -08:00
params.c kernel/params.c: Use kstrtobool() instead of strtobool() 2023-01-25 14:07:21 -08:00
pid.c
pid_namespace.c - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
pid_sysctl.h mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC 2023-01-18 17:12:37 -08:00
profile.c
ptrace.c rseq: Introduce extensible rseq ABI 2022-12-27 12:52:10 +01:00
range.c
reboot.c
regset.c
relay.c relayfs: fix out-of-bounds access in relay_file_read 2023-05-11 23:16:51 +09:00
resource.c dax/kmem: Fix leak of memory-hotplug resources 2023-02-17 14:58:01 -08:00
resource_kunit.c
rseq.c rseq: Extend struct rseq with per-memory-map concurrency ID 2022-12-27 12:52:12 +01:00
scftorture.c
scs.c
seccomp.c seccomp: fix kernel-doc function name warning 2023-01-13 17:01:06 -08:00
signal.c sched: Introduce per-memory-map concurrency ID 2022-12-27 12:52:11 +01:00
smp.c
smpboot.c
smpboot.h
softirq.c
stackleak.c
stacktrace.c
static_call.c
static_call_inline.c
stop_machine.c
sys.c kernel/sys.c: fix and improve control flow in __sys_setres[ug]id() 2023-04-18 14:22:12 -07:00
sys_ni.c
sysctl-test.c
sysctl.c sysctl: fix proc_dobool() usability 2023-02-21 13:34:07 -08:00
task_work.c
taskstats.c
torture.c torture: Fix hang during kthread shutdown phase 2023-01-05 12:10:35 -08:00
tracepoint.c tracepoint: Allow livepatch module add trace event 2023-02-18 14:34:36 -05:00
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c umh: simplify the capability pointer logic 2023-03-03 16:18:19 -08:00
up.c
user-return-notifier.c
user.c
user_namespace.c userns: fix a struct's kernel-doc notation 2023-02-02 22:50:04 -08:00
usermode_driver.c
utsname.c
utsname_sysctl.c
watch_queue.c watch_queue: fix IOC_WATCH_QUEUE_SET_SIZE alloc error paths 2023-03-08 11:44:45 +01:00
watchdog.c
watchdog_hld.c watchdog/perf: more properly prevent false positives with turbo modes 2023-07-11 19:39:29 +02:00
workqueue.c workqueue: Fix hung time report of worker pools 2023-05-11 23:17:30 +09:00
workqueue_internal.h