]> git.baikalelectronics.ru Git - kernel.git/commit
epoll: Fix user space breakage related to EPOLLWAKEUP
authorRafael J. Wysocki <rjw@sisk.pl>
Mon, 21 May 2012 19:20:48 +0000 (21:20 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Tue, 22 May 2012 18:57:06 +0000 (20:57 +0200)
commit975b555282eafc87f7a26c4a6a3b8eba516b482a
treead8642afda03a50c2e536afc2ffd906acd44c72c
parent6410a4d1e4a7ad54db7858936fde80b305308bea
epoll: Fix user space breakage related to EPOLLWAKEUP

Commit 6230651 (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>
fs/eventpoll.c