aboutsummaryrefslogtreecommitdiffstats
path: root/fs/eventpoll.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-05-21 15:20:48 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-22 14:57:06 -0400
commita8159414d7e3af7233e7a5a82d1c5d85379bd75c (patch)
treead8642afda03a50c2e536afc2ffd906acd44c72c /fs/eventpoll.c
parent2df83fa4bce421f8176932142f1004adfba0f9dd (diff)
epoll: Fix user space breakage related to EPOLLWAKEUP
Commit 4d7e30d (epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready) caused some applications to malfunction, because they set the bit corresponding to the new EPOLLWAKEUP flag in their eventpoll flags and they don't have the new CAP_EPOLLWAKEUP capability. To prevent that from happening, change epoll_ctl() to clear EPOLLWAKEUP in epds.events if the caller doesn't have the CAP_EPOLLWAKEUP capability instead of failing and returning an error code, which allows the affected applications to function normally. Reported-and-tested-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'fs/eventpoll.c')
-rw-r--r--fs/eventpoll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 2cf0f2153be5..079d1be65ba9 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1711,7 +1711,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
1711 1711
1712 /* Check if EPOLLWAKEUP is allowed */ 1712 /* Check if EPOLLWAKEUP is allowed */
1713 if ((epds.events & EPOLLWAKEUP) && !capable(CAP_EPOLLWAKEUP)) 1713 if ((epds.events & EPOLLWAKEUP) && !capable(CAP_EPOLLWAKEUP))
1714 goto error_tgt_fput; 1714 epds.events &= ~EPOLLWAKEUP;
1715 1715
1716 /* 1716 /*
1717 * We have to check that the file structure underneath the file descriptor 1717 * We have to check that the file structure underneath the file descriptor