hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/alpha/kernel/osf_sys.c
....@@ -529,7 +529,6 @@
529529
530530 SYSCALL_DEFINE1(osf_utsname, char __user *, name)
531531 {
532
- int error;
533532 char tmp[5 * 32];
534533
535534 down_read(&uts_sem);
....@@ -560,7 +559,7 @@
560559 */
561560 SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen)
562561 {
563
- int len, err = 0;
562
+ int len;
564563 char *kname;
565564 char tmp[32];
566565
....@@ -678,7 +677,7 @@
678677 default:
679678 error = -EOPNOTSUPP;
680679 break;
681
- };
680
+ }
682681 return error;
683682 }
684683
....@@ -964,36 +963,12 @@
964963 }
965964
966965 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)
968967 {
969968 return copy_to_user(o, &(struct timeval32){
970969 .tv_sec = i->tv_sec,
971970 .tv_usec = i->tv_usec},
972971 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));
997972 }
998973
999974 static inline void
....@@ -1039,47 +1014,6 @@
10391014 }
10401015
10411016 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
-}
10831017
10841018 SYSCALL_DEFINE2(osf_utimes, const char __user *, filename,
10851019 struct timeval32 __user *, tvs)
....@@ -1254,7 +1188,7 @@
12541188
12551189 SYSCALL_DEFINE1(old_adjtimex, struct timex32 __user *, txc_p)
12561190 {
1257
- struct timex txc;
1191
+ struct __kernel_timex txc;
12581192 int ret;
12591193
12601194 /* copy relevant bits of struct timex. */
....@@ -1271,7 +1205,8 @@
12711205 if (copy_to_user(txc_p, &txc, offsetof(struct timex32, time)) ||
12721206 (copy_to_user(&txc_p->tick, &txc.tick, sizeof(struct timex32) -
12731207 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)))
12751210 return -EFAULT;
12761211
12771212 return ret;
....@@ -1343,7 +1278,6 @@
13431278 }
13441279
13451280 #ifdef CONFIG_OSF4_COMPAT
1346
-
13471281 /* Clear top 32 bits of iov_len in the user's buffer for
13481282 compatibility with old versions of OSF/1 where iov_len
13491283 was defined as int. */
....@@ -1360,26 +1294,30 @@
13601294 }
13611295 return 0;
13621296 }
1297
+#endif
13631298
13641299 SYSCALL_DEFINE3(osf_readv, unsigned long, fd,
13651300 const struct iovec __user *, vector, unsigned long, count)
13661301 {
1302
+#ifdef CONFIG_OSF4_COMPAT
13671303 if (unlikely(personality(current->personality) == PER_OSF4))
13681304 if (osf_fix_iov_len(vector, count))
13691305 return -EFAULT;
1306
+#endif
1307
+
13701308 return sys_readv(fd, vector, count);
13711309 }
13721310
13731311 SYSCALL_DEFINE3(osf_writev, unsigned long, fd,
13741312 const struct iovec __user *, vector, unsigned long, count)
13751313 {
1314
+#ifdef CONFIG_OSF4_COMPAT
13761315 if (unlikely(personality(current->personality) == PER_OSF4))
13771316 if (osf_fix_iov_len(vector, count))
13781317 return -EFAULT;
1318
+#endif
13791319 return sys_writev(fd, vector, count);
13801320 }
1381
-
1382
-#endif
13831321
13841322 SYSCALL_DEFINE2(osf_getpriority, int, which, int, who)
13851323 {