[lkml]   [2007]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: Possible "struct pid" leak from tty_io.c
On 09/03/07, Eric W. Biederman <> wrote:
> If I can manage to focus on this, it looks like the information I need to
> start fixing this.

I had a look at the second leak reported it seems to be caused by the
same proc_set_tty() call but, in this case, there is no
disassociate_tty() call for the task (and the patch I posted is not
enough). Maybe something like below (no thourough testing):

diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index db91398..ea6ca7d 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3854,7 +3854,14 @@ EXPORT_SYMBOL(tty_devnum);

void proc_clear_tty(struct task_struct *p)
+ struct tty_struct *tty;
+ tty = p->signal->tty;
+ if (tty) {
+ put_pid(tty->session);
+ put_pid(tty->pgrp);
+ }
p->signal->tty = NULL;
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-03-12 16:11    [W:0.051 / U:0.200 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site