diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-11-04 16:40:32 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-11-04 16:40:32 +0100 |
| commit | 724ec7c190c1893ea55fd7143e7e1c8c5b61a0e7 (patch) | |
| tree | 6cc08145262424ad6c8179457ed188656c41015f /include/linux/time64.h | |
| parent | da31de35cd2fb78f75788873e0b61e56d4bb1a90 (diff) | |
| parent | 3cea11cd5e3b00d91caf0b4730194039b45c5891 (diff) | |
| download | linux-next-724ec7c190c1893ea55fd7143e7e1c8c5b61a0e7.tar.gz linux-next-724ec7c190c1893ea55fd7143e7e1c8c5b61a0e7.zip | |
Merge 5.10-rc2 into tty-next
We need the tty/vt/serial fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/time64.h')
| -rw-r--r-- | include/linux/time64.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/time64.h b/include/linux/time64.h index c9dcb3e5781f..5117cb5b5656 100644 --- a/include/linux/time64.h +++ b/include/linux/time64.h @@ -124,6 +124,10 @@ static inline bool timespec64_valid_settod(const struct timespec64 *ts) */ static inline s64 timespec64_to_ns(const struct timespec64 *ts) { + /* Prevent multiplication overflow */ + if ((unsigned long long)ts->tv_sec >= KTIME_SEC_MAX) + return KTIME_MAX; + return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; } |
