aboutsummaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-05-27 19:49:32 +0000
committerMark Johnston <markj@FreeBSD.org>2021-05-27 19:52:20 +0000
commite00bae5c181ac8282caf41cd33a076da03cf8ac9 (patch)
treee4cbacf87f6c78ad33f19e57c5e5edbd8ddc5ccd /lib/libc
parentf88510077377157008f648b7036e1d1c9c83ea23 (diff)
downloadsrc-e00bae5c181ac8282caf41cd33a076da03cf8ac9.tar.gz
src-e00bae5c181ac8282caf41cd33a076da03cf8ac9.zip
kevent: Prohibit negative change and event list lengths
Previously, a negative change list length would be treated the same as an empty change list. A negative event list length would result in bogus copyouts. Make kevent(2) return EINVAL for both cases so that application bugs are more easily found, and to be more robust against future changes to kevent internals. Reviewed by: imp, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30480
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/kqueue.24
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2
index b83d85d90d42..9be380bb5d99 100644
--- a/lib/libc/sys/kqueue.2
+++ b/lib/libc/sys/kqueue.2
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 8, 2020
+.Dd May 26, 2021
.Dt KQUEUE 2
.Os
.Sh NAME
@@ -762,6 +762,8 @@ events were placed on the kqueue for return.
A cancellation request was delivered to the thread, but not yet handled.
.It Bq Er EINVAL
The specified time limit or filter is invalid.
+.It Bq Er EINVAL
+The specified length of the event or change lists is negative.
.It Bq Er ENOENT
The event could not be found to be modified or deleted.
.It Bq Er ENOMEM