]> git.baikalelectronics.ru Git - kernel.git/commit
tty: audit: Simplify first-use allocation
authorPeter Hurley <peter@hurleysoftware.com>
Sun, 10 Jan 2016 06:55:36 +0000 (22:55 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Jan 2016 00:41:04 +0000 (16:41 -0800)
commit2720f8f267f20b865eb6b9c3da4b0eff210d40df
tree4ded90498dab94dce2f1c2c6679558ff217343fb
parent11167934774392a15960e84e8de81684d10284c6
tty: audit: Simplify first-use allocation

The first-use tty audit buffer allocation is a potential race
amongst multiple attempts at 'first-use'; only one 'winner' is
acceptable.

The successful buffer assignment occurs if tty_audit_buf == NULL
(which will also be the return from cmpxchg()); otherwise, another
racer 'won' and this buffer allocation is freed.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_audit.c