posix-timers: Get rid of [COMPAT_]SYS_NI() uses
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 19 Dec 2023 23:26:59 +0000 (15:26 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Jan 2024 10:51:46 +0000 (11:51 +0100)
commit766c6c1dd1403a5212888c74647532800169345c
tree59db230067069777b2db2144984389ed68bcb7e6
parent406cea6443b6b9276c227db16e768f3c7230ff89
posix-timers: Get rid of [COMPAT_]SYS_NI() uses

[ Upstream commit a4aebe936554dac6a91e5d091179c934f8325708 ]

Only the posix timer system calls use this (when the posix timer support
is disabled, which does not actually happen in any normal case), because
they had debug code to print out a warning about missing system calls.

Get rid of that special case, and just use the standard COND_SYSCALL
interface that creates weak system call stubs that return -ENOSYS for
when the system call does not exist.

This fixes a kCFI issue with the SYS_NI() hackery:

  CFI failure at int80_emulation+0x67/0xb0 (target: sys_ni_posix_timers+0x0/0x70; expected type: 0xb02b34d9)
  WARNING: CPU: 0 PID: 48 at int80_emulation+0x67/0xb0

Reported-by: kernel test robot <oliver.sang@intel.com>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Sami Tolvanen <samitolvanen@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/include/asm/syscall_wrapper.h
arch/riscv/include/asm/syscall_wrapper.h
arch/s390/include/asm/syscall_wrapper.h
arch/x86/include/asm/syscall_wrapper.h
kernel/sys_ni.c
kernel/time/posix-stubs.c