|author||Mark Johnston <markj@FreeBSD.org>||2021-05-27 19:49:32 +0000|
|committer||Mark Johnston <markj@FreeBSD.org>||2021-05-27 19:52:20 +0000|
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')
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
@@ -24,7 +24,7 @@
-.Dd October 8, 2020
+.Dd May 26, 2021
.Dt KQUEUE 2
@@ -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