All of the remaining syscalls that pass a timeval (gettimeofday, utime, futimesat) can trivially be changed to pass a __kernel_old_timeval instead, which has a compatible layout, but avoids ambiguity with the timeval type in user space.
Showing the changes to include/linux (1 of 7 files). Show all
Unified · Split
| @@ -51,7 +51,7 @@ struct statx; · 50 unmodified lines | |||
| 51 | struct __sysctl_args; | 51 | struct __sysctl_args; |
| 52 | struct sysinfo; | 52 | struct sysinfo; |
| 53 | struct timespec; | 53 | struct timespec; |
| 54 | struct timeval; | 54 | struct __kernel_old_timeval; |
| 55 | struct __kernel_timex; | 55 | struct __kernel_timex; |
| 56 | struct timezone; | 56 | struct timezone; |
| 57 | struct tms; | 57 | struct tms; |
| @@ -732,7 +732,7 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, · 674 unmodified lines | |||
| 732 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); | 732 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); |
| 733 | 733 | ||
| 734 | /* kernel/time.c */ | 734 | /* kernel/time.c */ |
| 735 | asmlinkage long sys_gettimeofday(struct timeval __user *tv, | 735 | asmlinkage long sys_gettimeofday(struct __kernel_old_timeval __user *tv, |
| 736 | struct timezone __user *tz); | 736 | struct timezone __user *tz); |
| 737 | asmlinkage long sys_settimeofday(struct timeval __user *tv, | 737 | asmlinkage long sys_settimeofday(struct timeval __user *tv, |
| 738 | struct timezone __user *tz); | 738 | struct timezone __user *tz); |
| @@ -1082,9 +1082,9 @@ asmlinkage long sys_time32(old_time32_t __user *tloc); · 343 unmodified lines | |||
| 1082 | asmlinkage long sys_utime(char __user *filename, | 1082 | asmlinkage long sys_utime(char __user *filename, |
| 1083 | struct utimbuf __user *times); | 1083 | struct utimbuf __user *times); |
| 1084 | asmlinkage long sys_utimes(char __user *filename, | 1084 | asmlinkage long sys_utimes(char __user *filename, |
| 1085 | struct timeval __user *utimes); | 1085 | struct __kernel_old_timeval __user *utimes); |
| 1086 | asmlinkage long sys_futimesat(int dfd, const char __user *filename, | 1086 | asmlinkage long sys_futimesat(int dfd, const char __user *filename, |
| 1087 | struct timeval __user *utimes); | 1087 | struct __kernel_old_timeval __user *utimes); |
| 1088 | #endif | 1088 | #endif |
| 1089 | asmlinkage long sys_futimesat_time32(unsigned int dfd, | 1089 | asmlinkage long sys_futimesat_time32(unsigned int dfd, |
| 1090 | const char __user *filename, | 1090 | const char __user *filename, |
| @@ -1098,7 +1098,7 @@ asmlinkage long sys_getdents(unsigned int fd, · 7 unmodified lines | |||
| 1098 | struct linux_dirent __user *dirent, | 1098 | struct linux_dirent __user *dirent, |
| 1099 | unsigned int count); | 1099 | unsigned int count); |
| 1100 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | 1100 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, |
| 1101 | fd_set __user *exp, struct timeval __user *tvp); | 1101 | fd_set __user *exp, struct __kernel_old_timeval __user *tvp); |
| 1102 | asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, | 1102 | asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, |
| 1103 | int timeout); | 1103 | int timeout); |
| 1104 | asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, | 1104 | asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events, |