oopses have been reported in do_acct_process(), with premption enabled, when
threaded applications are exitting.
It appears that we're racing with another thread which is nulling out
current->tty. I think this race is still there after we moved current->tty
into current->signal->tty, so let's take the needed lock.
/* we really need to bite the bullet and change layout */
ac.ac_uid = current->uid;
ac.ac_gid = current->gid;
- ac.ac_tty = current->signal->tty ? old_encode_dev(tty_devnum(current->signal->tty)) : 0;
+
+ read_lock(&tasklist_lock); /* pin current->signal */
+ ac.ac_tty = current->signal->tty ?
+ old_encode_dev(tty_devnum(current->signal->tty)) : 0;
+ read_unlock(&tasklist_lock);
ac.ac_flag = 0;
if (current->flags & PF_FORKNOEXEC)