mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 13:48:21 +00:00
syscalls: misc vulnerability fixes
This commit is contained in:
@@ -12,15 +12,13 @@ syscallret_t syscall_clockget(context_t *, int clockid, timespec_t *tp) {
|
||||
switch (clockid) {
|
||||
case CLOCK_REALTIME: {
|
||||
timespec_t ts = timekeeper_time();
|
||||
usercopy_touser(tp, &ts, sizeof(timespec_t));
|
||||
ret.errno = 0;
|
||||
ret.errno = usercopy_touser(tp, &ts, sizeof(timespec_t));
|
||||
break;
|
||||
}
|
||||
case CLOCK_MONOTONIC:
|
||||
case CLOCK_BOOTTIME: {
|
||||
timespec_t ts = timekeeper_timefromboot();
|
||||
usercopy_touser(tp, &ts, sizeof(timespec_t));
|
||||
ret.errno = 0;
|
||||
ret.errno = usercopy_touser(tp, &ts, sizeof(timespec_t));
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
Reference in New Issue
Block a user