Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
30b4c1c8
Commit
30b4c1c8
authored
Mar 07, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epoll: return proper error on overflow condition
Noted by Georgi Guninski.
parent
726a1180
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
fs/eventpoll.c
fs/eventpoll.c
+2
-1
No files found.
fs/eventpoll.c
View file @
30b4c1c8
...
...
@@ -619,6 +619,7 @@ sys_epoll_ctl(int epfd, int op, int fd, struct epoll_event __user *event)
return
error
;
}
#define MAX_EVENTS (INT_MAX / sizeof(struct epoll_event))
/*
* Implement the event wait interface for the eventpoll file. It is the kernel
...
...
@@ -635,7 +636,7 @@ asmlinkage long sys_epoll_wait(int epfd, struct epoll_event __user *events,
current
,
epfd
,
events
,
maxevents
,
timeout
));
/* The maximum number of event must be greater than zero */
if
(
maxevents
<=
0
)
if
(
maxevents
<=
0
||
maxevents
>
MAX_EVENTS
)
return
-
EINVAL
;
/* Verify that the area passed by the user is writeable */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment