Re: Kernel oops

From: Andrew Morton
Date: Tue Mar 09 2004 - 18:14:06 EST


Philipp Baer <phbaer@xxxxxxx> 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;

_

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