aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 7876a0226285..692e46a6b8da 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -775,15 +775,25 @@ asmlinkage long sys32_settimeofday(struct compat_timeval __user *tv,
775asmlinkage long sys32_utimes(char __user *filename, 775asmlinkage long sys32_utimes(char __user *filename,
776 struct compat_timeval __user *tvs) 776 struct compat_timeval __user *tvs)
777{ 777{
778 struct timeval ktvs[2]; 778 struct timespec tv[2];
779 779
780 if (tvs) { 780 if (tvs) {
781 struct timeval ktvs[2];
781 if (get_tv32(&ktvs[0], tvs) || 782 if (get_tv32(&ktvs[0], tvs) ||
782 get_tv32(&ktvs[1], 1+tvs)) 783 get_tv32(&ktvs[1], 1+tvs))
783 return -EFAULT; 784 return -EFAULT;
785
786 if (ktvs[0].tv_usec < 0 || ktvs[0].tv_usec >= 1000000 ||
787 ktvs[1].tv_usec < 0 || ktvs[1].tv_usec >= 1000000)
788 return -EINVAL;
789
790 tv[0].tv_sec = ktvs[0].tv_sec;
791 tv[0].tv_nsec = 1000 * ktvs[0].tv_usec;
792 tv[1].tv_sec = ktvs[1].tv_sec;
793 tv[1].tv_nsec = 1000 * ktvs[1].tv_usec;
784 } 794 }
785 795
786 return do_utimes(AT_FDCWD, filename, (tvs ? &ktvs[0] : NULL)); 796 return do_utimes(AT_FDCWD, filename, tvs ? tv : NULL);
787} 797}
788 798
789/* These are here just in case some old sparc32 binary calls it. */ 799/* These are here just in case some old sparc32 binary calls it. */