Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24544
b: refs/heads/master
c: 652486f
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and Linus Torvalds committed Mar 29, 2006
1 parent e7ac259 commit e5779bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f96a795d4f6a8a13abe4b0d3c5d1c28ea8d7ce4b
refs/heads/master: 652486fb84a07ed750f1c11639518f55808bf555
16 changes: 13 additions & 3 deletions trunk/drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2672,7 +2672,7 @@ static void __do_SAK(void *arg)
tty_hangup(tty);
#else
struct tty_struct *tty = arg;
struct task_struct *p;
struct task_struct *g, *p;
int session;
int i;
struct file *filp;
Expand All @@ -2693,8 +2693,18 @@ static void __do_SAK(void *arg)
tty->driver->flush_buffer(tty);

read_lock(&tasklist_lock);
/* Kill the entire session */
do_each_task_pid(session, PIDTYPE_SID, p) {
if (p->signal->tty == tty || session > 0) {
printk(KERN_NOTICE "SAK: killed process %d"
" (%s): p->signal->session==tty->session\n",
p->pid, p->comm);
send_sig(SIGKILL, p, 1);
} while_each_task_pid(session, PIDTYPE_SID, p);
/* Now kill any processes that happen to have the
* tty open.
*/
do_each_thread(g, p) {
if (p->signal->tty == tty) {
printk(KERN_NOTICE "SAK: killed process %d"
" (%s): p->signal->session==tty->session\n",
p->pid, p->comm);
Expand All @@ -2721,7 +2731,7 @@ static void __do_SAK(void *arg)
rcu_read_unlock();
}
task_unlock(p);
} while_each_task_pid(session, PIDTYPE_SID, p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
#endif
}
Expand Down

0 comments on commit e5779bf

Please sign in to comment.