LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Philipp Baer <phbaer@npw.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Kernel oops
Date: Tue, 9 Mar 2004 15:11:06 -0800	[thread overview]
Message-ID: <20040309151106.468cf467.akpm@osdl.org> (raw)
In-Reply-To: <404E41A7.80707@npw.net>

Philipp Baer <phbaer@npw.net> wrote:
>
> I have a strage problem with the kernel version 2.6.3. Whensoever
> chkrootkit is run, the following kernel oops is thrown:

Could you try this patch?


diff -puN drivers/char/tty_io.c~proc_pid_stat-oops-fix drivers/char/tty_io.c
--- 25/drivers/char/tty_io.c~proc_pid_stat-oops-fix	Tue Mar  9 15:10:12 2004
+++ 25-akpm/drivers/char/tty_io.c	Tue Mar  9 15:10:12 2004
@@ -481,12 +481,15 @@ void do_tty_hangup(void *data)
 	if (tty->session > 0) {
 		struct list_head *l;
 		for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) {
-			if (p->tty == tty)
-				p->tty = NULL;
-			if (!p->leader)
-				continue;
-			send_group_sig_info(SIGHUP, SEND_SIG_PRIV, p);
-			send_group_sig_info(SIGCONT, SEND_SIG_PRIV, p);
+			task_t *task = p;
+			do {
+				if (task->tty == tty)
+					task->tty = NULL;
+				if (task->leader) {
+					send_group_sig_info(SIGHUP, SEND_SIG_PRIV, task);
+					send_group_sig_info(SIGCONT, SEND_SIG_PRIV, task);
+				}
+			} while_each_thread(p, task);
 			if (tty->pgrp > 0)
 				p->tty_old_pgrp = tty->pgrp;
 		}
@@ -591,8 +594,12 @@ void disassociate_ctty(int on_exit)
 	tty->pgrp = -1;
 
 	read_lock(&tasklist_lock);
-	for_each_task_pid(current->session, PIDTYPE_SID, p, l, pid)
-		p->tty = NULL;
+	for_each_task_pid(current->session, PIDTYPE_SID, p, l, pid) {
+		task_t *task = p;
+		do
+			task->tty = NULL;
+		while_each_thread(p, task);
+	}
 	read_unlock(&tasklist_lock);
 	unlock_kernel();
 }
@@ -1260,11 +1267,20 @@ static void release_dev(struct file * fi
 		struct pid *pid;
 
 		read_lock(&tasklist_lock);
-		for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid)
-			p->tty = NULL;
-		if (o_tty)
-			for_each_task_pid(o_tty->session, PIDTYPE_SID, p,l, pid)
-				p->tty = NULL;
+		for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) {
+			task_t *task = p;
+			do
+				task->tty = NULL;
+			while_each_thread(p, task);
+		}
+		if (o_tty) {
+			for_each_task_pid(o_tty->session, PIDTYPE_SID, p,l, pid) {
+				task_t *task = p;
+				do
+					task->tty = NULL;
+				while_each_thread(p, task);
+			}
+		}
 		read_unlock(&tasklist_lock);
 	}
 
@@ -1615,8 +1631,12 @@ static int tiocsctty(struct tty_struct *
 			 */
 
 			read_lock(&tasklist_lock);
-			for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid)
-				p->tty = NULL;
+			for_each_task_pid(tty->session, PIDTYPE_SID, p, l, pid) {
+				task_t *task = p;
+				do
+					task->tty = NULL;
+				while_each_thread(p, task);
+			}
 			read_unlock(&tasklist_lock);
 		} else
 			return -EPERM;

_


  reply	other threads:[~2004-03-09 23:11 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-09 22:13 Philipp Baer
2004-03-09 23:11 ` Andrew Morton [this message]
2004-03-12  7:46   ` Philipp Baer
  -- strict thread matches above, loose matches on Subject: below --
2008-07-23 12:52 kernel oops Andrei Popa
2008-07-23 17:11 ` Vegard Nossum
2008-08-18 16:33   ` Vegard Nossum
2008-08-18 16:39     ` Greg KH
     [not found] <e8eb01770803120245x7690e6a9te8ad04296aa3fc4d@mail.gmail.com>
2008-03-12  9:49 ` Zbynek Drlik
2008-03-12 10:33   ` Al Viro
2008-03-12 13:12     ` Zbynek Drlik
2008-02-05 12:57 Andrej Hocevar
2008-02-06 17:55 ` Len Brown
2006-09-12 10:21 Kernel Oops Marcin Prączko
2006-09-13  3:43 ` Andrew Morton
2005-10-15  1:03 Marc Perkel
2005-10-15  1:21 ` Randy.Dunlap
2005-10-15  1:43   ` Marc Perkel
2005-10-15  1:52     ` Randy.Dunlap
2005-01-03 21:10 Kernel oops Marat BN
2005-01-05 10:13 ` Andrew Morton
2004-06-11  7:27 tmp
2004-05-24 20:19 tmp
2004-05-16 12:08 Kernel OOPS tmp
2004-05-16 23:27 ` Andrew Morton
2004-05-17  0:33   ` tmp
2004-02-08 11:05 Kernel Oops Mathieu LESNIAK
2004-02-08 16:35 ` Greg KH
2004-02-09  7:06   ` Mathieu LESNIAK
2003-11-28 23:15 Kernel oops Ville Jutvik
2003-11-28  5:45 Anderson Levi
2003-08-09 12:39 kernel oops Jean-Yves LENHOF
2003-08-09 20:37 ` Jean-Yves LENHOF
2003-08-09  9:28 Jean-Yves LENHOF
2003-07-18 19:44 Kernel OOPS Robert Scussel
2003-07-18 21:31 ` Alan Cox
2003-07-07 12:53 kernel oops Anders Karlsson
2003-07-07 13:14 ` Alan Cox
2003-07-07 13:32   ` Anders Karlsson
2003-07-07 13:37     ` Alan Cox
2003-07-07 13:56       ` Anders Karlsson
2003-07-08  9:39         ` Marcelo Tosatti
     [not found] ` <200307072009.50677.bernd-schubert@web.de>
2003-07-08  5:13   ` Anders Karlsson
2003-05-31  1:32 Nadeem Riaz
2003-03-26 15:52 Steve Terrell
2003-02-03  1:18 Kernel Oops Daniel Espinoza
2003-02-03  3:23 ` vishwas
2002-08-09  5:25 sanket rathi
2002-06-23 19:39 Dirk Schmidt
2002-06-10  8:46 kernel oops Robert Litwiniec
2002-02-26 18:26 Suporte RedeBonja
2002-02-27 13:35 ` Erik Mouw
2001-11-13 13:23 Kernel oops Anthony
2001-11-14  6:02 ` Thiago Rondon
2001-10-08 12:59 kernel oops Terry Kendal
2001-09-27  9:49 kewl
2001-06-01 15:13 Kernel oops David Harris
2001-06-01 15:12 David Harris
2001-04-19 18:32 kernel oops Ronald Bultje
2001-04-19 19:04 ` Alan Cox
2001-04-19 19:08   ` Ronald Bultje
2001-02-19 14:44 Kernel Oops Alberto Bertogli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040309151106.468cf467.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phbaer@npw.net \
    --subject='Re: Kernel oops' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).