mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
[PATCH] audit/accounting: tty locking
Add tty locking around the audit and accounting code. The whole current->signal-> locking is all deeply strange but it's for someone else to sort out. Add rather than replace the lock for acct.c Signed-off-by: Alan Cox <[email protected]> Acked-by: Arjan van de Ven <[email protected]> Cc: Al Viro <[email protected]> Cc: Oleg Nesterov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
5f412b2424
commit
eb84a20e9e
2 changed files with 10 additions and 1 deletions
|
|
@ -483,10 +483,14 @@ static void do_acct_process(struct file *file)
|
|||
ac.ac_ppid = current->parent->tgid;
|
||||
#endif
|
||||
|
||||
read_lock(&tasklist_lock); /* pin current->signal */
|
||||
mutex_lock(&tty_mutex);
|
||||
/* FIXME: Whoever is responsible for current->signal locking needs
|
||||
to use the same locking all over the kernel and document it */
|
||||
read_lock(&tasklist_lock);
|
||||
ac.ac_tty = current->signal->tty ?
|
||||
old_encode_dev(tty_devnum(current->signal->tty)) : 0;
|
||||
read_unlock(&tasklist_lock);
|
||||
mutex_unlock(&tty_mutex);
|
||||
|
||||
spin_lock_irq(¤t->sighand->siglock);
|
||||
ac.ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime)));
|
||||
|
|
|
|||
Loading…
Reference in a new issue