Home Home > GIT Browse > openSUSE-42.3
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-07-09 13:01:07 +0200
committerTakashi Iwai <tiwai@suse.de>2018-07-09 13:01:07 +0200
commit1b7b3b1250fe8e8cec42294d71886928db04b046 (patch)
tree30bbf80c74ed9ebc38b817bd78905bbe3dccf69e
parent743a46fa13f32f839a710b78dad4dfecdc30350c (diff)
alarmtimer: Prevent overflow for relative nanosleep
(CVE-2018-13053 bsc#1099924). suse-commit: c27577224bb367f4c4670ee47ee1410eead0e89e
-rw-r--r--kernel/time/alarmtimer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 6fcc367ad531..e78480b81f8d 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -773,7 +773,8 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags,
/* Convert (if necessary) to absolute time */
if (flags != TIMER_ABSTIME) {
ktime_t now = alarm_bases[type].gettime();
- exp = ktime_add(now, exp);
+
+ exp = ktime_add_safe(now, exp);
}
if (alarmtimer_do_nsleep(&alarm, exp))