linux/tools/testing/selftests
Christophe Leroy a7083f0ce5 powerpc/vdso: Flag VDSO64 entry points as functions
[ Upstream commit 0161bd38c2 ]

On powerpc64 as shown below by readelf, vDSO functions symbols have
type NOTYPE.

$ powerpc64-linux-gnu-readelf -a arch/powerpc/kernel/vdso/vdso64.so.dbg
ELF Header:
  Magic:   7f 45 4c 46 02 02 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           PowerPC64
  Version:                           0x1
...

Symbol table '.dynsym' contains 12 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
...
     1: 0000000000000524    84 NOTYPE  GLOBAL DEFAULT    8 __[...]@@LINUX_2.6.15
...
     4: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  ABS LINUX_2.6.15
     5: 00000000000006c0    48 NOTYPE  GLOBAL DEFAULT    8 __[...]@@LINUX_2.6.15

Symbol table '.symtab' contains 56 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
...
    45: 0000000000000000     0 OBJECT  GLOBAL DEFAULT  ABS LINUX_2.6.15
    46: 00000000000006c0    48 NOTYPE  GLOBAL DEFAULT    8 __kernel_getcpu
    47: 0000000000000524    84 NOTYPE  GLOBAL DEFAULT    8 __kernel_clock_getres

To overcome that, commit ba83b3239e ("selftests: vDSO: fix vDSO
symbols lookup for powerpc64") was applied to have selftests also
look for NOTYPE symbols, but the correct fix should be to flag VDSO
entry points as functions.

The original commit that brought VDSO support into powerpc/64 has the
following explanation:

    Note that the symbols exposed by the vDSO aren't "normal" function symbols, apps
    can't be expected to link against them directly, the vDSO's are both seen
    as if they were linked at 0 and the symbols just contain offsets to the
    various functions.  This is done on purpose to avoid a relocation step
    (ppc64 functions normally have descriptors with abs addresses in them).
    When glibc uses those functions, it's expected to use it's own trampolines
    that know how to reach them.

The descriptors it's talking about are the OPD function descriptors
used on ABI v1 (big endian). But it would be more correct for a text
symbol to have type function, even if there's no function descriptor
for it.

glibc has a special case already for handling the VDSO symbols which
creates a fake opd pointing at the kernel symbol. So changing the VDSO
symbol type to function shouldn't affect that.

For ABI v2, there is no function descriptors and VDSO functions can
safely have function type.

So lets flag VDSO entry points as functions and revert the
selftest change.

Link: 5f2dd691b6
Fixes: ba83b3239e ("selftests: vDSO: fix vDSO symbols lookup for powerpc64")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-By: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/b6ad2f1ee9887af3ca5ecade2a56f4acda517a85.1728512263.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-09 10:32:13 +01:00
..
alsa kselftest/alsa - conf: Stringify the printed errno in sysfs_get() 2024-01-25 15:35:40 -08:00
amd-pstate linux-kselftest-next-6.4-rc1 2023-04-24 12:28:34 -07:00
arm64 kselftest/arm64: mte: fix printf type warnings about longs 2024-12-09 10:31:43 +01:00
bpf selftests/bpf: Add push/pop checking for msg_verify_data in test_sockmap 2024-12-09 10:32:09 +01:00
breakpoints selftests: breakpoints: use remaining time to check if suspend succeed 2024-10-10 11:57:41 +02:00
cachestat selftests: cachestat: Fix build warnings on ppc64 2024-07-25 09:50:42 +02:00
capabilities .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
cgroup selftests: cgroup: skip test_cgcore_lesser_ns_open when cgroup2 mounted without nsdelegate 2024-06-12 11:12:00 +02:00
clone3 selftests/clone3: Fix broken test under !CONFIG_TIME_NS 2023-11-28 17:20:05 +00:00
connector selftests: connector: Fix input argument error paths to skip 2023-07-31 20:11:42 -07:00
core fix bitmap corruption on close_range() with CLOSE_RANGE_UNSHARE 2024-08-29 17:33:14 +02:00
cpu-hotplug selftests/cpu-hotplug: Add log info when test success 2022-10-05 11:05:18 -06:00
cpufreq selftests/cpufreq: Don't enable generic lock debugging options 2023-06-12 16:39:11 -06:00
damon selftests/damon/sysfs: test damon_target filter 2023-08-21 13:37:37 -07:00
dma selftests dma: fix compile error for dma_map_benchmark 2022-06-16 14:03:21 -06:00
dmabuf-heaps kselftests: dmabuf-heaps: Ensure the driver name is null-terminated 2024-09-12 11:11:38 +02:00
drivers mlxsw: spectrum_acl: Fix ACL scale regression and firmware errors 2024-08-03 08:53:38 +02:00
efivarfs selftests/efivarfs: create-read: fix a resource leak 2023-11-28 17:19:42 +00:00
exec linux-kselftest-next-5.18-rc1 2022-03-23 12:53:00 -07:00
fchmodat2 selftests: link libasan statically for tests with -fsanitize=address 2023-09-19 13:21:32 -07:00
filelock selftests: add OFD lock tests 2023-08-24 10:41:47 -04:00
filesystems selftests/binderfs: use the Makefile's rules, not Make's implicit rules 2024-06-12 11:11:49 +02:00
firmware selftests: firmware: Add firmware upload selftests 2022-04-29 16:49:36 +02:00
fpu selftests/fpu: Add an FPU selftest 2020-06-29 10:02:23 +02:00
ftrace tracing/probes: Support $argN in return probe (kprobe and fprobe) 2024-11-01 01:58:26 +01:00
futex selftests/futex: pass _GNU_SOURCE without a value to the compiler 2024-07-25 09:50:43 +02:00
gpio gpio updates for v6.5 2023-06-29 10:11:10 -07:00
hid selftest: hid: add the missing tests directory 2024-10-22 15:46:27 +02:00
ia64 .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
intel_pstate selftests/intel_pstate: fix build for ARCH=x86_64 2022-10-18 14:13:19 -06:00
iommu iommufd: Do not allow creating areas without READ or WRITE 2024-09-04 13:28:24 +02:00
ipc selftests: ipc: Fix incorrect kernel headers search path 2023-02-13 09:09:44 -07:00
ir kselftests/ir : Improve readability of modprobe error message 2022-05-16 13:34:19 -06:00
kcmp selftests/kcmp: remove unused open mode 2024-06-12 11:12:11 +02:00
kexec selftests/kexec: fix build for ARCH=x86_64 2022-10-18 14:13:25 -06:00
kmod testing: use the copyleft-next-0.3.1 SPDX tag 2022-11-08 15:44:02 +01:00
kselftest linux-kselftest-next-6.6-rc2 2023-09-12 09:10:36 -07:00
kvm KVM: selftests: Add test for uaccesses to non-existent vgic-v2 CPUIF 2024-06-12 11:11:27 +02:00
landlock selftests/landlock: Add cred_transfer test 2024-08-03 08:54:17 +02:00
lib selftests: lib: Add wrapper script for test_scanf 2021-05-19 15:05:11 +02:00
livepatch Merge branch 'for-6.1/sysfs-patched-object' into for-linus 2022-10-05 13:00:03 +02:00
lkdtm selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config 2023-11-28 17:19:36 +00:00
locking selftests: locking: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
media_tests selftests: media_tests: Add new subtest to video_device_test 2023-06-12 16:39:10 -06:00
membarrier linux-kselftest-next-6.3-rc1 2023-02-23 09:37:29 -08:00
memfd selftests: improve vm.memfd_noexec sysctl tests 2023-08-21 13:38:00 -07:00
memory-hotplug selftests/memory-hotplug: Remove the redundant warning information 2022-10-18 14:21:18 -06:00
mincore selftests/mincore: fix skip condition for check_huge_pages test 2023-07-13 12:51:13 -06:00
mm Revert "selftests/mm: replace atomic_bool with pthread_barrier_t" 2024-11-08 16:28:23 +01:00
mount selftests/mount: remove unneeded conversion to bool 2021-12-10 16:46:01 -07:00
mount_setattr selftests mount: Fix mount_setattr_test builds failed 2023-03-31 09:18:45 -06:00
move_mount_set_group selftests: move_mount_set_group: Fix incorrect kernel headers search path 2023-02-13 09:09:45 -07:00
mqueue selftests/mqueue: Set timeout to 180 seconds 2024-04-03 15:28:20 +02:00
nci NFC: nci: Extend virtual NCI deinit test 2022-11-21 10:49:58 +00:00
net selftests: net: really check for bg process completion 2024-12-09 10:32:10 +01:00
netfilter selftests: netfilter: Fix nft_audit.sh for newer nft binaries 2024-10-10 11:57:15 +02:00
nolibc selftests/nolibc: avoid passing NULL to printf("%s") 2024-10-10 11:57:30 +02:00
nsfs tools/testing: Replace zero-length array with flexible-array 2020-05-08 09:42:14 -06:00
ntb NTB: ntb_test: Fix bug when counting remote files 2020-06-05 20:02:09 -04:00
openat2 selftests/openat2: Fix build warnings on ppc64 2024-07-25 09:50:42 +02:00
perf_events selftests: perf_events: Fix incorrect kernel headers search path 2023-02-13 09:09:45 -07:00
pid_namespace selftests: pid_namespace: Fix incorrect kernel headers search path 2023-02-13 09:09:45 -07:00
pidfd selftests/pidfd: Fix ksft print formats 2023-11-20 11:59:17 +01:00
powerpc selftests/powerpc/dexcr: Add -no-pie to hashchk tests 2024-06-12 11:12:44 +02:00
prctl selftests:prctl: add set-process-name to .gitignore 2023-07-25 10:33:25 -06:00
proc selftests/proc: fixup proc-empty-vm test after KSM changes 2023-09-19 13:21:33 -07:00
pstore pstore/platform: Use backend name for console registration 2020-05-30 10:34:02 -07:00
ptp selftests/ptp: Add -X option for testing PTP_SYS_OFFSET_PRECISE 2023-07-28 10:59:40 +01:00
ptrace Update for entry and ptrace: 2023-04-25 11:05:04 -07:00
rcutorture clocksource: Scale the watchdog read retries automatically 2024-08-14 13:58:56 +02:00
resctrl selftests/resctrl: Protect against array overrun during iMC config parsing 2024-12-09 10:31:58 +01:00
riscv tools: selftests: riscv: Fix compile warnings in mm tests 2024-03-01 13:34:48 +01:00
rlimits kselftests: Add test to check for rlimit changes in different user namespaces 2021-04-30 14:14:03 -05:00
rseq selftests/rseq: Fix mm_cid test failure 2024-10-17 15:24:37 +02:00
rtc selftests: rtc: skip when RTC is not present 2022-11-15 13:30:51 -07:00
safesetid LSM: SafeSetID: add setgroups() testing to selftest 2022-07-15 18:24:42 +00:00
sched selftests: sched: Add more core schedule prctl calls 2023-03-28 10:27:07 -06:00
seccomp selftests/seccomp: Handle EINVAL on unshare(CLONE_NEWPID) 2024-05-02 16:32:42 +02:00
sgx selftests/sgx: Fix linker script asserts 2024-02-05 20:14:32 +00:00
sigaltstack selftests/sigaltstack: Fix ppc64 GCC build 2024-08-03 08:54:30 +02:00
size .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
sparc64 selftests/sparc64: remove ARRAY_SIZE define from adi-test 2021-12-10 17:51:15 -07:00
splice selftests: splice_read: Fix sysfs read cases 2022-11-29 17:28:31 -07:00
static_keys treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
sync selftests: sync: Fix incorrect kernel headers search path 2023-02-13 09:09:45 -07:00
syscall_user_dispatch selftests: sud_test: return correct emulated syscall value on RISC-V 2024-06-12 11:11:24 +02:00
sysctl test_sysclt: Test for registering a mount point 2023-06-18 02:32:54 -07:00
tc-testing tc-testing: don't access non-existent variable on exception 2024-08-29 17:33:45 +02:00
tdx selftests: tdx: Use installed kernel headers search path 2023-02-13 09:09:46 -07:00
timens selftest/timerns: fix clang build failures for abs() calls 2024-07-25 09:50:55 +02:00
timers selftests: timers: Fix valid-adjtimex signed left-shift undefined behavior 2024-05-17 12:02:16 +02:00
tmpfs .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
tpm2 selftests: tpm2: remove redundant ord() 2023-02-13 09:09:46 -07:00
tty selftests: tty: add selftest for tty timestamp updates 2023-06-15 13:45:42 +02:00
uevent selftests: Remove unneeded selftest API headers 2020-07-06 15:59:07 -06:00
user treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
user_events selftests/user_events: Fix abi_test for BE archs 2023-10-17 15:07:19 -06:00
vDSO powerpc/vdso: Flag VDSO64 entry points as functions 2024-12-09 10:32:13 +01:00
watchdog selftests/watchdog-test: Fix system accidentally reset after watchdog-test 2024-12-09 10:31:37 +01:00
wireguard wireguard: selftests: load nf_conntrack if not present 2024-12-09 10:32:12 +01:00
x86 selftests/x86/lam: Zero out buffer for readlink() 2023-11-20 11:58:54 +01:00
zram selftests/zram: Adapt the situation that /dev/zram0 is being used 2022-01-27 10:59:02 -07:00
.gitignore selftests: add kselftest_install to .gitignore 2022-03-03 15:16:57 -07:00
gen_kselftest_tar.sh selftests: introduce gen_tar Makefile target 2020-05-19 16:11:46 -06:00
kselftest.h kselftest: Add a ksft_perror() helper 2024-05-25 16:22:53 +02:00
kselftest_deps.sh selftests: fix dependency checker script 2023-09-08 10:06:49 -06:00
kselftest_harness.h selftests/harness: Actually report SKIP for signal tests 2023-08-10 23:10:09 -07:00
kselftest_install.sh selftests: gen_kselftest_tar.sh: Do not clobber kselftest/ 2019-11-07 14:43:27 -07:00
kselftest_module.h selftest: Taint kernel when test module loaded 2022-07-11 16:58:11 -06:00
lib.mk selftests: Introduce Makefile variable to list shared bash scripts 2024-10-17 15:24:13 +02:00
Makefile selftests: Introduce Makefile variable to list shared bash scripts 2024-10-17 15:24:13 +02:00
run_kselftest.sh kselftests: Sort the collections list to avoid duplicate tests 2023-06-12 16:39:11 -06:00