.. | .. |
---|
529 | 529 | |
---|
530 | 530 | SYSCALL_DEFINE1(osf_utsname, char __user *, name) |
---|
531 | 531 | { |
---|
532 | | - int error; |
---|
533 | 532 | char tmp[5 * 32]; |
---|
534 | 533 | |
---|
535 | 534 | down_read(&uts_sem); |
---|
.. | .. |
---|
560 | 559 | */ |
---|
561 | 560 | SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen) |
---|
562 | 561 | { |
---|
563 | | - int len, err = 0; |
---|
| 562 | + int len; |
---|
564 | 563 | char *kname; |
---|
565 | 564 | char tmp[32]; |
---|
566 | 565 | |
---|
.. | .. |
---|
678 | 677 | default: |
---|
679 | 678 | error = -EOPNOTSUPP; |
---|
680 | 679 | break; |
---|
681 | | - }; |
---|
| 680 | + } |
---|
682 | 681 | return error; |
---|
683 | 682 | } |
---|
684 | 683 | |
---|
.. | .. |
---|
964 | 963 | } |
---|
965 | 964 | |
---|
966 | 965 | static inline long |
---|
967 | | -put_tv_to_tv32(struct timeval32 __user *o, struct timeval *i) |
---|
| 966 | +put_tv_to_tv32(struct timeval32 __user *o, struct __kernel_old_timeval *i) |
---|
968 | 967 | { |
---|
969 | 968 | return copy_to_user(o, &(struct timeval32){ |
---|
970 | 969 | .tv_sec = i->tv_sec, |
---|
971 | 970 | .tv_usec = i->tv_usec}, |
---|
972 | 971 | sizeof(struct timeval32)); |
---|
973 | | -} |
---|
974 | | - |
---|
975 | | -static inline long |
---|
976 | | -get_it32(struct itimerval *o, struct itimerval32 __user *i) |
---|
977 | | -{ |
---|
978 | | - struct itimerval32 itv; |
---|
979 | | - if (copy_from_user(&itv, i, sizeof(struct itimerval32))) |
---|
980 | | - return -EFAULT; |
---|
981 | | - o->it_interval.tv_sec = itv.it_interval.tv_sec; |
---|
982 | | - o->it_interval.tv_usec = itv.it_interval.tv_usec; |
---|
983 | | - o->it_value.tv_sec = itv.it_value.tv_sec; |
---|
984 | | - o->it_value.tv_usec = itv.it_value.tv_usec; |
---|
985 | | - return 0; |
---|
986 | | -} |
---|
987 | | - |
---|
988 | | -static inline long |
---|
989 | | -put_it32(struct itimerval32 __user *o, struct itimerval *i) |
---|
990 | | -{ |
---|
991 | | - return copy_to_user(o, &(struct itimerval32){ |
---|
992 | | - .it_interval.tv_sec = o->it_interval.tv_sec, |
---|
993 | | - .it_interval.tv_usec = o->it_interval.tv_usec, |
---|
994 | | - .it_value.tv_sec = o->it_value.tv_sec, |
---|
995 | | - .it_value.tv_usec = o->it_value.tv_usec}, |
---|
996 | | - sizeof(struct itimerval32)); |
---|
997 | 972 | } |
---|
998 | 973 | |
---|
999 | 974 | static inline void |
---|
.. | .. |
---|
1039 | 1014 | } |
---|
1040 | 1015 | |
---|
1041 | 1016 | asmlinkage long sys_ni_posix_timers(void); |
---|
1042 | | - |
---|
1043 | | -SYSCALL_DEFINE2(osf_getitimer, int, which, struct itimerval32 __user *, it) |
---|
1044 | | -{ |
---|
1045 | | - struct itimerval kit; |
---|
1046 | | - int error; |
---|
1047 | | - |
---|
1048 | | - if (!IS_ENABLED(CONFIG_POSIX_TIMERS)) |
---|
1049 | | - return sys_ni_posix_timers(); |
---|
1050 | | - |
---|
1051 | | - error = do_getitimer(which, &kit); |
---|
1052 | | - if (!error && put_it32(it, &kit)) |
---|
1053 | | - error = -EFAULT; |
---|
1054 | | - |
---|
1055 | | - return error; |
---|
1056 | | -} |
---|
1057 | | - |
---|
1058 | | -SYSCALL_DEFINE3(osf_setitimer, int, which, struct itimerval32 __user *, in, |
---|
1059 | | - struct itimerval32 __user *, out) |
---|
1060 | | -{ |
---|
1061 | | - struct itimerval kin, kout; |
---|
1062 | | - int error; |
---|
1063 | | - |
---|
1064 | | - if (!IS_ENABLED(CONFIG_POSIX_TIMERS)) |
---|
1065 | | - return sys_ni_posix_timers(); |
---|
1066 | | - |
---|
1067 | | - if (in) { |
---|
1068 | | - if (get_it32(&kin, in)) |
---|
1069 | | - return -EFAULT; |
---|
1070 | | - } else |
---|
1071 | | - memset(&kin, 0, sizeof(kin)); |
---|
1072 | | - |
---|
1073 | | - error = do_setitimer(which, &kin, out ? &kout : NULL); |
---|
1074 | | - if (error || !out) |
---|
1075 | | - return error; |
---|
1076 | | - |
---|
1077 | | - if (put_it32(out, &kout)) |
---|
1078 | | - return -EFAULT; |
---|
1079 | | - |
---|
1080 | | - return 0; |
---|
1081 | | - |
---|
1082 | | -} |
---|
1083 | 1017 | |
---|
1084 | 1018 | SYSCALL_DEFINE2(osf_utimes, const char __user *, filename, |
---|
1085 | 1019 | struct timeval32 __user *, tvs) |
---|
.. | .. |
---|
1254 | 1188 | |
---|
1255 | 1189 | SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p) |
---|
1256 | 1190 | { |
---|
1257 | | - struct timex txc; |
---|
| 1191 | + struct __kernel_timex txc; |
---|
1258 | 1192 | int ret; |
---|
1259 | 1193 | |
---|
1260 | 1194 | /* copy relevant bits of struct timex. */ |
---|
.. | .. |
---|
1271 | 1205 | if (copy_to_user(txc_p, &txc, offsetof(struct timex32, time)) || |
---|
1272 | 1206 | (copy_to_user(&txc_p->tick, &txc.tick, sizeof(struct timex32) - |
---|
1273 | 1207 | offsetof(struct timex32, tick))) || |
---|
1274 | | - (put_tv_to_tv32(&txc_p->time, &txc.time))) |
---|
| 1208 | + (put_user(txc.time.tv_sec, &txc_p->time.tv_sec)) || |
---|
| 1209 | + (put_user(txc.time.tv_usec, &txc_p->time.tv_usec))) |
---|
1275 | 1210 | return -EFAULT; |
---|
1276 | 1211 | |
---|
1277 | 1212 | return ret; |
---|
.. | .. |
---|
1343 | 1278 | } |
---|
1344 | 1279 | |
---|
1345 | 1280 | #ifdef CONFIG_OSF4_COMPAT |
---|
1346 | | - |
---|
1347 | 1281 | /* Clear top 32 bits of iov_len in the user's buffer for |
---|
1348 | 1282 | compatibility with old versions of OSF/1 where iov_len |
---|
1349 | 1283 | was defined as int. */ |
---|
.. | .. |
---|
1360 | 1294 | } |
---|
1361 | 1295 | return 0; |
---|
1362 | 1296 | } |
---|
| 1297 | +#endif |
---|
1363 | 1298 | |
---|
1364 | 1299 | SYSCALL_DEFINE3(osf_readv, unsigned long, fd, |
---|
1365 | 1300 | const struct iovec __user *, vector, unsigned long, count) |
---|
1366 | 1301 | { |
---|
| 1302 | +#ifdef CONFIG_OSF4_COMPAT |
---|
1367 | 1303 | if (unlikely(personality(current->personality) == PER_OSF4)) |
---|
1368 | 1304 | if (osf_fix_iov_len(vector, count)) |
---|
1369 | 1305 | return -EFAULT; |
---|
| 1306 | +#endif |
---|
| 1307 | + |
---|
1370 | 1308 | return sys_readv(fd, vector, count); |
---|
1371 | 1309 | } |
---|
1372 | 1310 | |
---|
1373 | 1311 | SYSCALL_DEFINE3(osf_writev, unsigned long, fd, |
---|
1374 | 1312 | const struct iovec __user *, vector, unsigned long, count) |
---|
1375 | 1313 | { |
---|
| 1314 | +#ifdef CONFIG_OSF4_COMPAT |
---|
1376 | 1315 | if (unlikely(personality(current->personality) == PER_OSF4)) |
---|
1377 | 1316 | if (osf_fix_iov_len(vector, count)) |
---|
1378 | 1317 | return -EFAULT; |
---|
| 1318 | +#endif |
---|
1379 | 1319 | return sys_writev(fd, vector, count); |
---|
1380 | 1320 | } |
---|
1381 | | - |
---|
1382 | | -#endif |
---|
1383 | 1321 | |
---|
1384 | 1322 | SYSCALL_DEFINE2(osf_getpriority, int, which, int, who) |
---|
1385 | 1323 | { |
---|