mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
tty: audit: Remove false memory optimization
The tty audit buffer is allocated at first use and not freed until the process exits. If tty audit is turned off after the audit buffer has been allocated, no effort is made to release the buffer. So re-checking if tty audit has just been turned off when tty audit was just on is false optimization; the likelihood of triggering this condition is exceedingly small. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2e28d38ae1
commit
5c8b3185c4
@ -200,8 +200,7 @@ int tty_audit_push(void)
|
|||||||
* tty_audit_buf_get - Get an audit buffer.
|
* tty_audit_buf_get - Get an audit buffer.
|
||||||
*
|
*
|
||||||
* Get an audit buffer, allocate it if necessary. Return %NULL
|
* Get an audit buffer, allocate it if necessary. Return %NULL
|
||||||
* if TTY auditing is disabled or out of memory. Otherwise, return a new
|
* if out of memory. Otherwise, return a new reference to the buffer.
|
||||||
* reference to the buffer.
|
|
||||||
*/
|
*/
|
||||||
static struct tty_audit_buf *tty_audit_buf_get(void)
|
static struct tty_audit_buf *tty_audit_buf_get(void)
|
||||||
{
|
{
|
||||||
@ -224,9 +223,6 @@ static struct tty_audit_buf *tty_audit_buf_get(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (~current->signal->audit_tty & AUDIT_TTY_ENABLE)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
spin_lock_irqsave(¤t->sighand->siglock, flags);
|
spin_lock_irqsave(¤t->sighand->siglock, flags);
|
||||||
buf = current->signal->tty_audit_buf;
|
buf = current->signal->tty_audit_buf;
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
|
Loading…
Reference in New Issue
Block a user