Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

audit: do not needlessly take a lock in tty_audit_exit

We were doing spin_lock_irq and spin_unlock_irq. This is STOOPID.

If we were in interupt context we were already screwed and called
panic() in do_exit(). So the irq stuff is useless. Also, these values
can only be changed by receiving a netlink message from current. Since
we are in do_exit() clearly we aren't in the syscall sending the netlink
message to change these values. Thus, just read them and go with it.

Signed-off-by: Eric Paris <eparis@redhat.com>

-3
-3
drivers/tty/tty_audit.c
··· 111 111 void tty_audit_exit(void) 112 112 { 113 113 struct tty_audit_buf *buf; 114 - unsigned long flags; 115 114 116 - spin_lock_irqsave(&current->sighand->siglock, flags); 117 115 buf = current->signal->tty_audit_buf; 118 116 current->signal->tty_audit_buf = NULL; 119 - spin_unlock_irqrestore(&current->sighand->siglock, flags); 120 117 if (!buf) 121 118 return; 122 119