diff options
author | 2018-06-15 01:09:49 +0000 | |
---|---|---|
committer | 2018-06-15 01:09:49 +0000 | |
commit | 21228684728196a32b48f93519924ab0b1b1d105 (patch) | |
tree | 586ad5c9fdcd64d54904e87e910a85d12015282d | |
parent | silence a compiler warning (diff) | |
download | wireguard-openbsd-21228684728196a32b48f93519924ab0b1b1d105.tar.xz wireguard-openbsd-21228684728196a32b48f93519924ab0b1b1d105.zip |
kevent: don't reject timeouts greater than 100 million seconds
We already clamp timeouts to 24 hours anyway, so there's no reason
to set EINVAL because the caller's timeout passed an arbitrary
threshold.
In particular, this keeps www/chromium v67 from busy-waiting and
consuming a ton of cpu as described in the bug report here:
https://bugs.chromium.org/p/chromium/issues/detail?id=850450
Prompted by deraadt@, bug report found by pirofti@,
testing by brynet@ and deraadt@.
ok kettenis@
-rw-r--r-- | sys/kern/kern_event.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 61e363a4d04..ba10b9eafac 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.91 2018/06/05 09:29:05 mpi Exp $ */ +/* $OpenBSD: kern_event.c,v 1.92 2018/06/15 01:09:49 cheloha Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -705,7 +705,7 @@ kqueue_scan(struct kqueue *kq, int maxevents, struct kevent *ulistp, if (tsp != NULL) { ats = *tsp; - if (ats.tv_sec > 100000000 || timespecfix(&ats)) { + if (timespecfix(&ats)) { error = EINVAL; goto done; } |