tcp: select(writefds) don't hang up when a peer close connection
[pandora-kernel.git] / kernel / signal.c
index 906ae5a..bded651 100644 (file)
@@ -637,7 +637,7 @@ static inline bool si_fromuser(const struct siginfo *info)
 
 /*
  * Bad permissions for sending the signal
- * - the caller must hold at least the RCU read lock
+ * - the caller must hold the RCU read lock
  */
 static int check_kill_permission(int sig, struct siginfo *info,
                                 struct task_struct *t)
@@ -1127,11 +1127,14 @@ struct sighand_struct *lock_task_sighand(struct task_struct *tsk, unsigned long
 
 /*
  * send signal info to all the members of a group
- * - the caller must hold the RCU read lock at least
  */
 int group_send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
 {
-       int ret = check_kill_permission(sig, info, p);
+       int ret;
+
+       rcu_read_lock();
+       ret = check_kill_permission(sig, info, p);
+       rcu_read_unlock();
 
        if (!ret && sig)
                ret = do_send_sig_info(sig, info, p, true);