epoll: Check for fdtable races
PATCH 1/1 epoll: Check for fdtable races
In case it's possible to race with other tasks sharing the fdtable, check for NULL file * and exit with an error.
Please consider merging this with the first patch in the series of epoll patches posted recently.
--- fs/eventpoll.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
fs/eventpoll.c +2 -1
@@ -1677,7 +1677,8 @@ struct file* ep_file_restore(struct ckpt_ctx *ctx,return ERR_PTR (epfd); epfile =fget (epfd);sys_close (epfd);/* harmless even if an error occured */ -BUG_ON (!epfile); +if (!epfile) +return ERR_PTR (-EBADF );/* * Needed before we can properly restore the watches and enforce the
Signature · 1 line
1.5.6.3
A message that is not in the archive (sent off-list or not yet received): 1256321658-15646-1-git-send-email-matthltc-r/[email protected]
Quoted 9 lines · Matt Helsley
In case it's possible to race with other tasks sharing the fdtable, check for NULL file * and exit with an error.
Please consider merging this with the first patch in the series of epoll patches posted recently.
Reported-by "Serge E. Hallyn" <serue-r/[email protected]>Signed-off-by Matt Helsley <matthltc-r/[email protected]>Cc "Serge E. Hallyn" <serue-r/[email protected]>
Already did that when I pulled your patch.
BTW, I chose -EBUSY instead to tell the user to try again later... when he/she isn't malicious anymore :)
Oren.
Quoted 18 lines
--- fs/eventpoll.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)fs/eventpoll.c +2
-1@@ -1677,7 +1677,8 @@ struct file* ep_file_restore(struct ckpt_ctx *ctx,return ERR_PTR (epfd); epfile =fget (epfd);sys_close (epfd);/* harmless even if an error occured */ -BUG_ON (!epfile); +if (!epfile) +return ERR_PTR (-EBADF );/* * Needed before we can properly restore the watches and enforce the
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Oren Laadan
Quoted 6 lines · Matt Helsley
In case it's possible to race with other tasks sharing the fdtable, check for NULL file * and exit with an error.
Please consider merging this with the first patch in the series of epoll patches posted recently.
Quoted 8 lines
Quoted 3 lines
Reported-by "Serge E. Hallyn" <serue-r/[email protected]>Signed-off-by Matt Helsley <matthltc-r/[email protected]>Cc "Serge E. Hallyn" <serue-r/[email protected]>Already did that when I pulled your patch.
BTW, I chose
-EBUSYinstead to tell the user to try again later... when he/she isn't malicious anymore :)
"Go stand in the corner and don't come out until you'll be NICE to your brother!"
-serge