aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel/osf_sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha/kernel/osf_sys.c')
-rw-r--r--arch/alpha/kernel/osf_sys.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c
index ea405f5713ce..ce857158c1ea 100644
--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -953,15 +953,25 @@ osf_setitimer(int which, struct itimerval32 __user *in, struct itimerval32 __use
953asmlinkage int 953asmlinkage int
954osf_utimes(char __user *filename, struct timeval32 __user *tvs) 954osf_utimes(char __user *filename, struct timeval32 __user *tvs)
955{ 955{
956 struct timeval ktvs[2]; 956 struct timespec tv[2];
957 957
958 if (tvs) { 958 if (tvs) {
959 struct timeval ktvs[2];
959 if (get_tv32(&ktvs[0], &tvs[0]) || 960 if (get_tv32(&ktvs[0], &tvs[0]) ||
960 get_tv32(&ktvs[1], &tvs[1])) 961 get_tv32(&ktvs[1], &tvs[1]))
961 return -EFAULT; 962 return -EFAULT;
963
964 if (ktvs[0].tv_usec < 0 || ktvs[0].tv_usec >= 1000000 ||
965 ktvs[1].tv_usec < 0 || ktvs[1].tv_usec >= 1000000)
966 return -EINVAL;
967
968 tv[0].tv_sec = ktvs[0].tv_sec;
969 tv[0].tv_nsec = 1000 * ktvs[0].tv_usec;
970 tv[1].tv_sec = ktvs[1].tv_sec;
971 tv[1].tv_nsec = 1000 * ktvs[1].tv_usec;
962 } 972 }
963 973
964 return do_utimes(AT_FDCWD, filename, tvs ? ktvs : NULL); 974 return do_utimes(AT_FDCWD, filename, tvs ? tv : NULL, 0);
965} 975}
966 976
967#define MAX_SELECT_SECONDS \ 977#define MAX_SELECT_SECONDS \