Commit 77d55918 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

signals: eventpoll: do not use sigprocmask()

sigprocmask() should die. None of the current callers actually
need this strange interface.

Change fs/eventpoll.c to use set_current_blocked(). This also
means we should not worry about SIGKILL/SIGSTOP.
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Eric Wong <normalperson@yhbt.net>
Cc: Jason Baron <jbaron@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 29000cae
...@@ -1975,8 +1975,8 @@ SYSCALL_DEFINE6(epoll_pwait, int, epfd, struct epoll_event __user *, events, ...@@ -1975,8 +1975,8 @@ SYSCALL_DEFINE6(epoll_pwait, int, epfd, struct epoll_event __user *, events,
return -EINVAL; return -EINVAL;
if (copy_from_user(&ksigmask, sigmask, sizeof(ksigmask))) if (copy_from_user(&ksigmask, sigmask, sizeof(ksigmask)))
return -EFAULT; return -EFAULT;
sigdelsetmask(&ksigmask, sigmask(SIGKILL) | sigmask(SIGSTOP)); sigsaved = current->blocked;
sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); set_current_blocked(&ksigmask);
} }
error = sys_epoll_wait(epfd, events, maxevents, timeout); error = sys_epoll_wait(epfd, events, maxevents, timeout);
...@@ -1993,7 +1993,7 @@ SYSCALL_DEFINE6(epoll_pwait, int, epfd, struct epoll_event __user *, events, ...@@ -1993,7 +1993,7 @@ SYSCALL_DEFINE6(epoll_pwait, int, epfd, struct epoll_event __user *, events,
sizeof(sigsaved)); sizeof(sigsaved));
set_restore_sigmask(); set_restore_sigmask();
} else } else
sigprocmask(SIG_SETMASK, &sigsaved, NULL); set_current_blocked(&sigsaved);
} }
return error; return error;
...@@ -2020,8 +2020,8 @@ COMPAT_SYSCALL_DEFINE6(epoll_pwait, int, epfd, ...@@ -2020,8 +2020,8 @@ COMPAT_SYSCALL_DEFINE6(epoll_pwait, int, epfd,
if (copy_from_user(&csigmask, sigmask, sizeof(csigmask))) if (copy_from_user(&csigmask, sigmask, sizeof(csigmask)))
return -EFAULT; return -EFAULT;
sigset_from_compat(&ksigmask, &csigmask); sigset_from_compat(&ksigmask, &csigmask);
sigdelsetmask(&ksigmask, sigmask(SIGKILL) | sigmask(SIGSTOP)); sigsaved = current->blocked;
sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); set_current_blocked(&ksigmask);
} }
err = sys_epoll_wait(epfd, events, maxevents, timeout); err = sys_epoll_wait(epfd, events, maxevents, timeout);
...@@ -2038,7 +2038,7 @@ COMPAT_SYSCALL_DEFINE6(epoll_pwait, int, epfd, ...@@ -2038,7 +2038,7 @@ COMPAT_SYSCALL_DEFINE6(epoll_pwait, int, epfd,
sizeof(sigsaved)); sizeof(sigsaved));
set_restore_sigmask(); set_restore_sigmask();
} else } else
sigprocmask(SIG_SETMASK, &sigsaved, NULL); set_current_blocked(&sigsaved);
} }
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment