lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b0943d9e0703120807t796e6c62k2422a93f6161db3a@mail.gmail.com>
Date:	Mon, 12 Mar 2007 15:07:39 +0000
From:	"Catalin Marinas" <catalin.marinas@...il.com>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>
Cc:	"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>
Subject: Re: Possible "struct pid" leak from tty_io.c

On 09/03/07, Eric W. Biederman <ebiederm@...ssion.com> 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;
+
 	spin_lock_irq(&p->sighand->siglock);
+	tty = p->signal->tty;
+	if (tty) {
+		put_pid(tty->session);
+		put_pid(tty->pgrp);
+	}
 	p->signal->tty = NULL;
 	spin_unlock_irq(&p->sighand->siglock);
 }

-- 
Catalin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ