<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty/tty_audit.c, branch v4.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-03-08T00:11:14Z</updated>
<entry>
<title>tty: audit: remove unused variable</title>
<updated>2016-03-08T00:11:14Z</updated>
<author>
<name>Sudip Mukherjee</name>
<email>sudipm.mukherjee@gmail.com</email>
</author>
<published>2016-02-24T11:15:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54555919e8a1b5881b130ed5dea8023ff009cbe7'/>
<id>urn:sha1:54555919e8a1b5881b130ed5dea8023ff009cbe7</id>
<content type='text'>
While building with W=1 we were getting build warning:
drivers/tty/tty_audit.c:149:16: warning: variable 'sessionid' set but not used

The local variable sessionid was only assigned the value of
current-&gt;sessionid but was never reused. On further inspection it turned
out that there is no need of audit_get_loginuid() also.

Signed-off-by: Sudip Mukherjee &lt;sudip.mukherjee@codethink.co.uk&gt;
Reviewed-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: audit: Poison tty_audit_buf while process exits</title>
<updated>2016-01-28T00:41:04Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-10T06:55:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=55b6314a17e8ad53233e9d0ebf6328734720e93b'/>
<id>urn:sha1:55b6314a17e8ad53233e9d0ebf6328734720e93b</id>
<content type='text'>
Warn if tty_audit_buf use is attempted after tty_audit_exit() has
already freed it.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: audit: Always push audit buffer before TIOCSTI</title>
<updated>2016-01-28T00:41:04Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-10T06:55:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=82b5c93a00169614a75d5fa3b5974f832a7857c7'/>
<id>urn:sha1:82b5c93a00169614a75d5fa3b5974f832a7857c7</id>
<content type='text'>
The data read from another tty may be relevant to the action of
the TIOCSTI ioctl; log the audit buffer immediately.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: audit: Check audit enable first</title>
<updated>2016-01-28T00:41:04Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-10T06:55:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f17c3662745ea5fd4510c3dff19f9975552e1865'/>
<id>urn:sha1:f17c3662745ea5fd4510c3dff19f9975552e1865</id>
<content type='text'>
Audit is unlikely to be enabled; check first to exit asap.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: audit: Simplify first-use allocation</title>
<updated>2016-01-28T00:41:04Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-10T06:55:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fbaa122718a1235f4f83baa3abaad21cfefdbc9d'/>
<id>urn:sha1:fbaa122718a1235f4f83baa3abaad21cfefdbc9d</id>
<content type='text'>
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 &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: audit: Remove tty_audit_buf reference counting</title>
<updated>2016-01-28T00:41:04Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-10T06:55:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5493090fc2341d9f28bdd9e81445fe0a130bafc2'/>
<id>urn:sha1:5493090fc2341d9f28bdd9e81445fe0a130bafc2</id>
<content type='text'>
When tty_audit_exit() is called from do_exit(), the process is
single-threaded. Since the tty_audit_buf is only shared by threads
of a process, no other thread can be concurrently accessing the
tty_audit_buf during or after tty_audit_exit().

Thus, no other thread can be holding an extra tty_audit_buf reference
which would prevent tty_audit_exit() from freeing the tty_audit_buf.
As that is the only purpose of the ref counting, remove the reference
counting and free the tty_audit_buf directly.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: audit: Remove false memory optimization</title>
<updated>2016-01-28T00:41:04Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-10T06:55:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5c8b3185c41cd7f7c1e39c6e300daac8ef547e7e'/>
<id>urn:sha1:5c8b3185c41cd7f7c1e39c6e300daac8ef547e7e</id>
<content type='text'>
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 &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: audit: Handle tty audit enable atomically</title>
<updated>2016-01-28T00:41:04Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-10T06:55:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e28d38ae1d9ced6ac2deb4001aca3f267304cdb'/>
<id>urn:sha1:2e28d38ae1d9ced6ac2deb4001aca3f267304cdb</id>
<content type='text'>
The audit_tty and audit_tty_log_passwd fields are actually bool
values, so merge into single memory location to access atomically.

NB: audit log operations may still occur after tty audit is disabled
which is consistent with the existing functionality

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: audit: Track tty association with dev_t</title>
<updated>2016-01-28T00:41:04Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-10T06:55:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4d240b6442824df3b5e401459789bab5ee7777ae'/>
<id>urn:sha1:4d240b6442824df3b5e401459789bab5ee7777ae</id>
<content type='text'>
Use dev_t instead of separate major/minor fields to track tty
audit buffer association.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: audit: Combine push functions</title>
<updated>2016-01-28T00:41:04Z</updated>
<author>
<name>Peter Hurley</name>
<email>peter@hurleysoftware.com</email>
</author>
<published>2016-01-10T06:55:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=37282a77954aa2dbb339d15902290f25b868d2e8'/>
<id>urn:sha1:37282a77954aa2dbb339d15902290f25b868d2e8</id>
<content type='text'>
tty_audit_push() and tty_audit_push_current() perform identical
tasks; eliminate the tty_audit_push() implementation and the
tty_audit_push_current() name.

Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
