summaryrefslogtreecommitdiffstats
path: root/kernel/time/posix-timers.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/posix-timers.c')
-rw-r--r--kernel/time/posix-timers.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 4b9127e95430..3e71921668ba 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -755,13 +755,13 @@ SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,
755#ifdef CONFIG_COMPAT_32BIT_TIME 755#ifdef CONFIG_COMPAT_32BIT_TIME
756 756
757COMPAT_SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, 757COMPAT_SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,
758 struct compat_itimerspec __user *, setting) 758 struct old_itimerspec32 __user *, setting)
759{ 759{
760 struct itimerspec64 cur_setting; 760 struct itimerspec64 cur_setting;
761 761
762 int ret = do_timer_gettime(timer_id, &cur_setting); 762 int ret = do_timer_gettime(timer_id, &cur_setting);
763 if (!ret) { 763 if (!ret) {
764 if (put_compat_itimerspec64(&cur_setting, setting)) 764 if (put_old_itimerspec32(&cur_setting, setting))
765 ret = -EFAULT; 765 ret = -EFAULT;
766 } 766 }
767 return ret; 767 return ret;
@@ -928,8 +928,8 @@ SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
928 928
929#ifdef CONFIG_COMPAT_32BIT_TIME 929#ifdef CONFIG_COMPAT_32BIT_TIME
930COMPAT_SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, 930COMPAT_SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
931 struct compat_itimerspec __user *, new, 931 struct old_itimerspec32 __user *, new,
932 struct compat_itimerspec __user *, old) 932 struct old_itimerspec32 __user *, old)
933{ 933{
934 struct itimerspec64 new_spec, old_spec; 934 struct itimerspec64 new_spec, old_spec;
935 struct itimerspec64 *rtn = old ? &old_spec : NULL; 935 struct itimerspec64 *rtn = old ? &old_spec : NULL;
@@ -937,12 +937,12 @@ COMPAT_SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
937 937
938 if (!new) 938 if (!new)
939 return -EINVAL; 939 return -EINVAL;
940 if (get_compat_itimerspec64(&new_spec, new)) 940 if (get_old_itimerspec32(&new_spec, new))
941 return -EFAULT; 941 return -EFAULT;
942 942
943 error = do_timer_settime(timer_id, flags, &new_spec, rtn); 943 error = do_timer_settime(timer_id, flags, &new_spec, rtn);
944 if (!error && old) { 944 if (!error && old) {
945 if (put_compat_itimerspec64(&old_spec, old)) 945 if (put_old_itimerspec32(&old_spec, old))
946 error = -EFAULT; 946 error = -EFAULT;
947 } 947 }
948 return error; 948 return error;
@@ -1115,7 +1115,7 @@ SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock,
1115#ifdef CONFIG_COMPAT_32BIT_TIME 1115#ifdef CONFIG_COMPAT_32BIT_TIME
1116 1116
1117COMPAT_SYSCALL_DEFINE2(clock_settime, clockid_t, which_clock, 1117COMPAT_SYSCALL_DEFINE2(clock_settime, clockid_t, which_clock,
1118 struct compat_timespec __user *, tp) 1118 struct old_timespec32 __user *, tp)
1119{ 1119{
1120 const struct k_clock *kc = clockid_to_kclock(which_clock); 1120 const struct k_clock *kc = clockid_to_kclock(which_clock);
1121 struct timespec64 ts; 1121 struct timespec64 ts;
@@ -1123,14 +1123,14 @@ COMPAT_SYSCALL_DEFINE2(clock_settime, clockid_t, which_clock,
1123 if (!kc || !kc->clock_set) 1123 if (!kc || !kc->clock_set)
1124 return -EINVAL; 1124 return -EINVAL;
1125 1125
1126 if (compat_get_timespec64(&ts, tp)) 1126 if (get_old_timespec32(&ts, tp))
1127 return -EFAULT; 1127 return -EFAULT;
1128 1128
1129 return kc->clock_set(which_clock, &ts); 1129 return kc->clock_set(which_clock, &ts);
1130} 1130}
1131 1131
1132COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock, 1132COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock,
1133 struct compat_timespec __user *, tp) 1133 struct old_timespec32 __user *, tp)
1134{ 1134{
1135 const struct k_clock *kc = clockid_to_kclock(which_clock); 1135 const struct k_clock *kc = clockid_to_kclock(which_clock);
1136 struct timespec64 ts; 1136 struct timespec64 ts;
@@ -1141,7 +1141,7 @@ COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock,
1141 1141
1142 err = kc->clock_get(which_clock, &ts); 1142 err = kc->clock_get(which_clock, &ts);
1143 1143
1144 if (!err && compat_put_timespec64(&ts, tp)) 1144 if (!err && put_old_timespec32(&ts, tp))
1145 err = -EFAULT; 1145 err = -EFAULT;
1146 1146
1147 return err; 1147 return err;
@@ -1180,7 +1180,7 @@ COMPAT_SYSCALL_DEFINE2(clock_adjtime, clockid_t, which_clock,
1180#ifdef CONFIG_COMPAT_32BIT_TIME 1180#ifdef CONFIG_COMPAT_32BIT_TIME
1181 1181
1182COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock, 1182COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock,
1183 struct compat_timespec __user *, tp) 1183 struct old_timespec32 __user *, tp)
1184{ 1184{
1185 const struct k_clock *kc = clockid_to_kclock(which_clock); 1185 const struct k_clock *kc = clockid_to_kclock(which_clock);
1186 struct timespec64 ts; 1186 struct timespec64 ts;
@@ -1190,7 +1190,7 @@ COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock,
1190 return -EINVAL; 1190 return -EINVAL;
1191 1191
1192 err = kc->clock_getres(which_clock, &ts); 1192 err = kc->clock_getres(which_clock, &ts);
1193 if (!err && tp && compat_put_timespec64(&ts, tp)) 1193 if (!err && tp && put_old_timespec32(&ts, tp))
1194 return -EFAULT; 1194 return -EFAULT;
1195 1195
1196 return err; 1196 return err;
@@ -1237,8 +1237,8 @@ SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
1237#ifdef CONFIG_COMPAT_32BIT_TIME 1237#ifdef CONFIG_COMPAT_32BIT_TIME
1238 1238
1239COMPAT_SYSCALL_DEFINE4(clock_nanosleep, clockid_t, which_clock, int, flags, 1239COMPAT_SYSCALL_DEFINE4(clock_nanosleep, clockid_t, which_clock, int, flags,
1240 struct compat_timespec __user *, rqtp, 1240 struct old_timespec32 __user *, rqtp,
1241 struct compat_timespec __user *, rmtp) 1241 struct old_timespec32 __user *, rmtp)
1242{ 1242{
1243 const struct k_clock *kc = clockid_to_kclock(which_clock); 1243 const struct k_clock *kc = clockid_to_kclock(which_clock);
1244 struct timespec64 t; 1244 struct timespec64 t;
@@ -1248,7 +1248,7 @@ COMPAT_SYSCALL_DEFINE4(clock_nanosleep, clockid_t, which_clock, int, flags,
1248 if (!kc->nsleep) 1248 if (!kc->nsleep)
1249 return -EOPNOTSUPP; 1249 return -EOPNOTSUPP;
1250 1250
1251 if (compat_get_timespec64(&t, rqtp)) 1251 if (get_old_timespec32(&t, rqtp))
1252 return -EFAULT; 1252 return -EFAULT;
1253 1253
1254 if (!timespec64_valid(&t)) 1254 if (!timespec64_valid(&t))