diff --git a/include/linux/time64.h b/include/linux/time64.h index 5117cb5b56561878d10126cd2fbef4b65b46574b..96a062f144652dc285610a68c4a4ce911299c688 100644 --- a/include/linux/time64.h +++ b/include/linux/time64.h @@ -4,6 +4,7 @@ #include #include +#include typedef __s64 time64_t; typedef __u64 timeu64_t; @@ -86,6 +87,7 @@ static inline struct timespec64 timespec64_sub(struct timespec64 lhs, */ static inline bool timespec64_valid(const struct timespec64 *ts) { + pr_err("[ywr_debug] FUNC: %s;Incoming data: %d\n",__func__,ts->tv_sec); /* Dates before 1970 are bogus */ if (ts->tv_sec < 0) return false; @@ -107,9 +109,11 @@ static inline bool timespec64_valid_strict(const struct timespec64 *ts) static inline bool timespec64_valid_settod(const struct timespec64 *ts) { + pr_err("[ywr_debug] FUNC: %s;Incoming data: %d\n",__func__,ts->tv_sec); if (!timespec64_valid(ts)) return false; /* Disallow values which cause overflow issues vs. CLOCK_REALTIME */ + pr_err("[ywr_debug] FUNC: %s;TIME_SETTOD_SEC_MAX: %d\n",__func__,TIME_SETTOD_SEC_MAX); if ((unsigned long long)ts->tv_sec >= TIME_SETTOD_SEC_MAX) return false; return true; diff --git a/kernel/time/time.c b/kernel/time/time.c index 3985b2b32d083e06acfee3c83f952426660dbe9d..6447b0a132b64b8b3f4621ad2582b7bfc5314eee 100644 --- a/kernel/time/time.c +++ b/kernel/time/time.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -201,7 +202,7 @@ SYSCALL_DEFINE2(settimeofday, struct __kernel_old_timeval __user *, tv, { struct timespec64 new_ts; struct timezone new_tz; - + pr_err("[ywr_debug] FUNC: %s;Incoming data: %d\n",__func__,tv->tv_sec); if (tv) { if (get_user(new_ts.tv_sec, &tv->tv_sec) || get_user(new_ts.tv_nsec, &tv->tv_usec)) @@ -245,7 +246,7 @@ COMPAT_SYSCALL_DEFINE2(settimeofday, struct old_timeval32 __user *, tv, { struct timespec64 new_ts; struct timezone new_tz; - + pr_err("[ywr_debug] FUNC: %s;Incoming data: %d\n",__func__,tv->tv_sec); if (tv) { if (get_user(new_ts.tv_sec, &tv->tv_sec) || get_user(new_ts.tv_nsec, &tv->tv_usec)) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index d9b48f7a35e0dbcf48cb15be33f8875babf8594f..c61fb899d37cd521c0f6eee9a338e2a9f32fe9ea 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "tick-internal.h" #include "ntp_internal.h" @@ -1302,7 +1303,7 @@ int do_settimeofday64(const struct timespec64 *ts) struct timespec64 ts_delta, xt; unsigned long flags; int ret = 0; - + pr_err("[ywr_debug] FUNC: %s;Incoming data: %d\n",__func__,ts->tv_sec); if (!timespec64_valid_settod(ts)) return -EINVAL;