tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.uaccess head: f75113b74705920dfc1b6960b7f8e8399feec001 commit: 245f442aa4ee691f5d66a8776d20d60e811d3eb6 [92/112] clock_gettime/clock_settime/clock_getres: move to native syscalls config: x86_64-randconfig-x019-201723 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: git checkout 245f442aa4ee691f5d66a8776d20d60e811d3eb6 # save the attached .config to linux build tree make ARCH=x86_64 All error/warnings (new ones prefixed by >>): In file included from kernel/time/posix-stubs.c:20:0: >> include/linux/compat.h:50:18: error: conflicting types for 'compat_sys_clock_settime' asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ ^ >> include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx' COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~ >> kernel/time/posix-stubs.c:138:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE2' COMPAT_SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, ^~~~~~~~~~~~~~~~~~~~~~ include/linux/compat.h:625:17: note: previous declaration of 'compat_sys_clock_settime' was here asmlinkage long compat_sys_clock_settime(clockid_t which_clock, ^~~~~~~~~~~~~~~~~~~~~~~~ >> include/linux/compat.h:50:18: error: conflicting types for 'compat_sys_clock_gettime' asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ ^ >> include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx' COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~ kernel/time/posix-stubs.c:153:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE2' COMPAT_SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, ^~~~~~~~~~~~~~~~~~~~~~ include/linux/compat.h:627:17: note: previous declaration of 'compat_sys_clock_gettime' was here asmlinkage long compat_sys_clock_gettime(clockid_t which_clock, ^~~~~~~~~~~~~~~~~~~~~~~~ >> include/linux/compat.h:50:18: error: conflicting types for 'compat_sys_clock_getres' asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ ^ >> include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx' COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~ kernel/time/posix-stubs.c:172:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE2' COMPAT_SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct timespec __user *, tp) ^~~~~~~~~~~~~~~~~~~~~~ include/linux/compat.h:631:17: note: previous declaration of 'compat_sys_clock_getres' was here asmlinkage long compat_sys_clock_getres(clockid_t which_clock, ^~~~~~~~~~~~~~~~~~~~~~~ -- In file included from kernel//time/posix-stubs.c:20:0: >> include/linux/compat.h:50:18: error: conflicting types for 'compat_sys_clock_settime' asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ ^ >> include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx' COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~ kernel//time/posix-stubs.c:138:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE2' COMPAT_SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, ^~~~~~~~~~~~~~~~~~~~~~ include/linux/compat.h:625:17: note: previous declaration of 'compat_sys_clock_settime' was here asmlinkage long compat_sys_clock_settime(clockid_t which_clock, ^~~~~~~~~~~~~~~~~~~~~~~~ >> include/linux/compat.h:50:18: error: conflicting types for 'compat_sys_clock_gettime' asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ ^ >> include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx' COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~ kernel//time/posix-stubs.c:153:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE2' COMPAT_SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, ^~~~~~~~~~~~~~~~~~~~~~ include/linux/compat.h:627:17: note: previous declaration of 'compat_sys_clock_gettime' was here asmlinkage long compat_sys_clock_gettime(clockid_t which_clock, ^~~~~~~~~~~~~~~~~~~~~~~~ >> include/linux/compat.h:50:18: error: conflicting types for 'compat_sys_clock_getres' asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))\ ^ >> include/linux/compat.h:39:2: note: in expansion of macro 'COMPAT_SYSCALL_DEFINEx' COMPAT_SYSCALL_DEFINEx(2, _##name, __VA_ARGS__) ^~~~~~~~~~~~~~~~~~~~~~ kernel//time/posix-stubs.c:172:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE2' COMPAT_SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct timespec __user *, tp) ^~~~~~~~~~~~~~~~~~~~~~ include/linux/compat.h:631:17: note: previous declaration of 'compat_sys_clock_getres' was here asmlinkage long compat_sys_clock_getres(clockid_t which_clock, ^~~~~~~~~~~~~~~~~~~~~~~ vim +/COMPAT_SYSCALL_DEFINE2 +138 kernel/time/posix-stubs.c 14 #include <linux/sched.h> 15 #include <linux/errno.h> 16 #include <linux/syscalls.h> 17 #include <linux/ktime.h> 18 #include <linux/timekeeping.h> 19 #include <linux/posix-timers.h> > 20 #include <linux/compat.h> 21 22 asmlinkage long sys_ni_posix_timers(void) 23 { 24 pr_err_once("process %d (%s) attempted a POSIX timer syscall " 25 "while CONFIG_POSIX_TIMERS is not set\n", 26 current->pid, current->comm); 27 return -ENOSYS; 28 } 29 30 #define SYS_NI(name) SYSCALL_ALIAS(sys_##name, sys_ni_posix_timers) 31 #define COMPAT_SYS_NI(name) SYSCALL_ALIAS(compat_sys_##name, sys_ni_posix_timers) 32 33 SYS_NI(timer_create); 34 SYS_NI(timer_gettime); 35 SYS_NI(timer_getoverrun); 36 SYS_NI(timer_settime); 37 SYS_NI(timer_delete); 38 SYS_NI(clock_adjtime); 39 SYS_NI(getitimer); 40 SYS_NI(setitimer); 41 #ifdef __ARCH_WANT_SYS_ALARM 42 SYS_NI(alarm); 43 #endif 44 COMPAT_SYS_NI(clock_adjtime); 45 COMPAT_SYS_NI(timer_settime); 46 COMPAT_SYS_NI(timer_gettime); 47 COMPAT_SYS_NI(getitimer); 48 COMPAT_SYS_NI(setitimer); 49 50 /* 51 * We preserve minimal support for CLOCK_REALTIME and CLOCK_MONOTONIC 52 * as it is easy to remain compatible with little code. CLOCK_BOOTTIME 53 * is also included for convenience as at least systemd uses it. 54 */ 55 56 SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, 57 const struct timespec __user *, tp) 58 { 59 struct timespec64 new_tp64; 60 struct timespec new_tp; 61 62 if (which_clock != CLOCK_REALTIME) 63 return -EINVAL; 64 if (copy_from_user(&new_tp, tp, sizeof (*tp))) 65 return -EFAULT; 66 67 new_tp64 = timespec_to_timespec64(new_tp); 68 return do_sys_settimeofday64(&new_tp64, NULL); 69 } 70 71 SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, 72 struct timespec __user *,tp) 73 { 74 struct timespec64 kernel_tp64; 75 struct timespec kernel_tp; 76 77 switch (which_clock) { 78 case CLOCK_REALTIME: ktime_get_real_ts64(&kernel_tp64); break; 79 case CLOCK_MONOTONIC: ktime_get_ts64(&kernel_tp64); break; 80 case CLOCK_BOOTTIME: get_monotonic_boottime64(&kernel_tp64); break; 81 default: return -EINVAL; 82 } 83 84 kernel_tp = timespec64_to_timespec(kernel_tp64); 85 if (copy_to_user(tp, &kernel_tp, sizeof (kernel_tp))) 86 return -EFAULT; 87 return 0; 88 } 89 90 SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct timespec __user *, tp) 91 { 92 struct timespec rtn_tp = { 93 .tv_sec = 0, 94 .tv_nsec = hrtimer_resolution, 95 }; 96 97 switch (which_clock) { 98 case CLOCK_REALTIME: 99 case CLOCK_MONOTONIC: 100 case CLOCK_BOOTTIME: 101 if (copy_to_user(tp, &rtn_tp, sizeof(rtn_tp))) 102 return -EFAULT; 103 return 0; 104 default: 105 return -EINVAL; 106 } 107 } 108 109 SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, 110 const struct timespec __user *, rqtp, 111 struct timespec __user *, rmtp) 112 { 113 struct timespec64 t64; 114 struct timespec t; 115 116 switch (which_clock) { 117 case CLOCK_REALTIME: 118 case CLOCK_MONOTONIC: 119 case CLOCK_BOOTTIME: 120 if (copy_from_user(&t, rqtp, sizeof (struct timespec))) 121 return -EFAULT; 122 t64 = timespec_to_timespec64(t); 123 if (!timespec64_valid(&t64)) 124 return -EINVAL; 125 if (flags & TIMER_ABSTIME) 126 rmtp = NULL; 127 current->restart_block.nanosleep.kind = rmtp ? 1 : 0; 128 current->restart_block.nanosleep.rmtp = rmtp; 129 return hrtimer_nanosleep(&t64, flags & TIMER_ABSTIME ? 130 HRTIMER_MODE_ABS : HRTIMER_MODE_REL, 131 which_clock); 132 default: 133 return -EINVAL; 134 } 135 } 136 137 #ifdef CONFIG_COMPAT > 138 COMPAT_SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, 139 const struct timespec __user *, tp) 140 { 141 struct timespec64 new_tp64; --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip