]> git.baikalelectronics.ru Git - kernel.git/commit
signals: don't abuse __flush_signals() in selinux_bprm_committed_creds()
authorOleg Nesterov <oleg@redhat.com>
Thu, 4 Jun 2015 20:22:16 +0000 (16:22 -0400)
committerPaul Moore <pmoore@redhat.com>
Thu, 4 Jun 2015 20:22:16 +0000 (16:22 -0400)
commit95f1e1d7581210001bc668a018343bbc1d862ef7
treeffbe4be8b34649fd07898137aeb74404f4fa093f
parentc2018892ab0661a7c9248db6c055d1b572e48fd4
signals: don't abuse __flush_signals() in selinux_bprm_committed_creds()

selinux_bprm_committed_creds()->__flush_signals() is not right, we
shouldn't clear TIF_SIGPENDING unconditionally. There can be other
reasons for signal_pending(): freezing(), JOBCTL_PENDING_MASK, and
potentially more.

Also change this code to check fatal_signal_pending() rather than
SIGNAL_GROUP_EXIT, it looks a bit better.

Now we can kill __flush_signals() before it finds another buggy user.

Note: this code looks racy, we can flush a signal which was sent after
the task SID has been updated.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Paul Moore <pmoore@redhat.com>
include/linux/sched.h
kernel/signal.c
security/selinux/hooks.c