Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102012522
D30480.id90027.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D30480.id90027.diff
View Options
diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2
--- 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 @@
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
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1303,6 +1303,9 @@
struct kevent *kevp, *changes;
int i, n, nerrors, error;
+ if (nchanges < 0)
+ return (EINVAL);
+
nerrors = 0;
while (nchanges > 0) {
n = nchanges > KQ_NEVENTS ? KQ_NEVENTS : nchanges;
@@ -1887,6 +1890,10 @@
if (maxevents == 0)
goto done_nl;
+ if (maxevents < 0) {
+ error = EINVAL;
+ goto done_nl;
+ }
rsbt = 0;
if (tsp != NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 1:13 PM (10 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14502448
Default Alt Text
D30480.id90027.diff (1 KB)
Attached To
Mode
D30480: kevent: Prohibit negative change and event list lengths
Attached
Detach File
Event Timeline
Log In to Comment