]> Git Repo - linux.git/commit - include/linux/tty.h
audit: Call tty_audit_push_task() outside preempt disabled
authorThomas Gleixner <[email protected]>
Wed, 9 Dec 2009 14:19:31 +0000 (14:19 +0000)
committerAl Viro <[email protected]>
Sat, 30 Oct 2010 12:45:25 +0000 (08:45 -0400)
commit3c80fe4ac9cfb13b1bfa4edf1544e8b656716694
treec605435b642323cd76eea9567a43d8c67b9c9db1
parentf7a998a9491f2da1d3e44d150aa611d10093da4f
audit: Call tty_audit_push_task() outside preempt disabled

While auditing all tasklist_lock read_lock sites I stumbled over the
following call chain:

audit_prepare_user_tty()
  read_lock(&tasklist_lock);
  tty_audit_push_task();
     mutex_lock(&buf->mutex);

     --> buf->mutex is locked with preemption disabled.

Solve this by acquiring a reference to the task struct under
rcu_read_lock and call tty_audit_push_task outside of the preempt
disabled region.

Move all code which needs to be protected by sighand lock into
tty_audit_push_task() and use lock/unlock_sighand as we do not hold
tasklist_lock.

Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Eric Paris <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Signed-off-by: Al Viro <[email protected]>
drivers/char/tty_audit.c
include/linux/tty.h
kernel/audit.c
This page took 0.057685 seconds and 4 git commands to generate.