Nicolas Iooss c680e41b3a eventpoll: fix uninitialized variable in epoll_ctl
When calling epoll_ctl with operation EPOLL_CTL_DEL, structure epds is
not initialized but ep_take_care_of_epollwakeup reads its event field.
When this unintialized field has EPOLLWAKEUP bit set, a capability check
is done for CAP_BLOCK_SUSPEND in ep_take_care_of_epollwakeup.  This
produces unexpected messages in the audit log, such as (on a system
running SELinux):

    type=AVC msg=audit(1408212798.866:410): avc:  denied
    { block_suspend } for  pid=7754 comm="dbus-daemon" capability=36
    scontext=unconfined_u:unconfined_r:unconfined_t
    tcontext=unconfined_u:unconfined_r:unconfined_t
    tclass=capability2 permissive=1

    type=SYSCALL msg=audit(1408212798.866:410): arch=c000003e syscall=233
    success=yes exit=0 a0=3 a1=2 a2=9 a3=7fffd4d66ec0 items=0 ppid=1
    pid=7754 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0
    fsgid=0 tty=(none) ses=3 comm="dbus-daemon"
    exe="/usr/bin/dbus-daemon"
    subj=unconfined_u:unconfined_r:unconfined_t key=(null)

("arch=c000003e syscall=233 a1=2" means "epoll_ctl(op=EPOLL_CTL_DEL)")

Remove use of epds in epoll_ctl when op == EPOLL_CTL_DEL.

Fixes: 4d7e30d98939 ("epoll: Add a flag, EPOLLWAKEUP, to prevent suspend while epoll events are ready")
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-09-10 15:42:12 -07:00
..
2014-08-08 15:57:24 -07:00
2014-08-08 15:57:20 -07:00
2014-06-04 16:53:53 -07:00
2014-08-06 18:01:12 -07:00
2014-08-07 14:40:09 -04:00
2014-08-08 18:13:21 -07:00
2014-08-26 16:17:48 -04:00
2014-09-08 12:02:03 -04:00
2014-01-25 03:14:05 -05:00
2014-08-06 18:01:12 -07:00
2014-07-15 22:40:23 +02:00
2014-07-31 15:52:51 +03:00
2014-08-07 14:40:09 -04:00
2013-10-24 23:34:54 -04:00
2014-08-07 14:40:11 -04:00
2014-08-08 15:57:23 -07:00
2014-08-08 15:57:31 -07:00
2014-05-06 17:31:10 -04:00
2013-10-24 23:34:54 -04:00
2014-02-07 16:08:57 -08:00
2014-08-07 14:40:08 -04:00
2014-08-07 14:40:09 -04:00
2014-05-06 17:39:42 -04:00
2014-04-01 23:19:08 -04:00
2013-11-09 00:16:31 -05:00
2014-07-23 10:18:02 -07:00