lkml.org 
[lkml]   [2003]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: heavy handed exit() in latest BK

Roland,

there are two bugs in the signal code still:

- a read_lock(&tasklist_lock) is missing around the group_send_sig_info()
in send_sig_info().

- session-IDs and group-IDs are set outside the tasklist lock. This
causes breakage in the USB code. The correct fix is to do this:

void __set_special_pids(pid_t session, pid_t pgrp)
{
struct task_struct *curr = current;

if (curr->session != session) {
detach_pid(curr, PIDTYPE_SID);
curr->session = session;
attach_pid(curr, PIDTYPE_SID, session);
}
if (curr->pgrp != pgrp) {
detach_pid(curr, PIDTYPE_PGID);
curr->pgrp = pgrp;
attach_pid(curr, PIDTYPE_PGID, pgrp);
}
}

void set_special_pids(pid_t session, pid_t pgrp)
{
write_lock_irq(&tasklist_lock);
__set_special_pids(session, pgrp);
write_unlock_irq(&tasklist_lock);
}

and then update all places that do:

- current->session = 1;
- current->pgrp = 1;

to:

+ set_special_pids(1, 1);

otherwise we change the PIDs without properly rehashing them.

Ingo

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

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.048 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site