<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/char/tty_io.c, branch linux-2.6.23.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.23.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.23.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2007-08-24T04:39:41Z</updated>
<entry>
<title>tty: dont needlessly cast kmalloc() return value</title>
<updated>2007-08-24T04:39:41Z</updated>
<author>
<name>Jesper Juhl</name>
</author>
<published>2007-08-24T00:28:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=abcb1ff326bfe74f3611d7de653276540ea060dd'/>
<id>urn:sha1:abcb1ff326bfe74f3611d7de653276540ea060dd</id>
<content type='text'>
kmalloc() hands us a void pointer, we don't need to cast it.

Signed-off-by: Jesper Juhl &lt;jesper.juhl@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fix serial buffer memory leak</title>
<updated>2007-08-11T22:47:41Z</updated>
<author>
<name>Alan Cox</name>
</author>
<published>2007-08-10T20:01:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=42fd552e8647316757ded0176466c41d17934dcf'/>
<id>urn:sha1:42fd552e8647316757ded0176466c41d17934dcf</id>
<content type='text'>
Patch c5c34d4862e18ef07c1276d233507f540fb5a532 (tty: flush flip buffer on
ldisc input queue flush) introduces a race condition which can lead to memory
leaks.

The problem can be triggered when tcflush() is called when data are being
pushed to the line discipline driver by flush_to_ldisc().

flush_to_ldisc() releases tty-&gt;buf.lock when calling the line discipline
receive_buf function. At that poing tty_buffer_flush() kicks in and sets both
tty-&gt;buf.head and tty-&gt;buf.tail to NULL. When flush_to_ldisc() finishes, it
restores tty-&gt;buf.head but doesn't touch tty-&gt;buf.tail. This corrups the
buffer queue, and the next call to tty_buffer_request_room() will allocate a
new buffer and overwrite tty-&gt;buf.head. The previous buffer is then lost
forever without being released.

(Thanks to Laurent for the above text, for finding, disgnosing and reporting
the bug)

- Use tty-&gt;flags bits for the flush status.

- Wait for the flag to clear again before returning

- Fix the doc error noted

- Fix flush of empty queue leaving stale flushpending

[akpm@linux-foundation.org: cleanup]
Signed-off-by: Alan Cox &lt;alan@redhat.com&gt;
Acked-by: Paul Fulghum &lt;paulkf@microgate.com&gt;
Cc: Laurent Pinchart &lt;laurentp@cse-semaphore.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Audit: add TTY input auditing</title>
<updated>2007-07-16T16:05:47Z</updated>
<author>
<name>Miloslav Trmac</name>
</author>
<published>2007-07-16T06:40:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=522ed7767e800cff6c650ec64b0ee0677303119c'/>
<id>urn:sha1:522ed7767e800cff6c650ec64b0ee0677303119c</id>
<content type='text'>
Add TTY input auditing, used to audit system administrator's actions.  This is
required by various security standards such as DCID 6/3 and PCI to provide
non-repudiation of administrator's actions and to allow a review of past
actions if the administrator seems to overstep their duties or if the system
becomes misconfigured for unknown reasons.  These requirements do not make it
necessary to audit TTY output as well.

Compared to an user-space keylogger, this approach records TTY input using the
audit subsystem, correlated with other audit events, and it is completely
transparent to the user-space application (e.g.  the console ioctls still
work).

TTY input auditing works on a higher level than auditing all system calls
within the session, which would produce an overwhelming amount of mostly
useless audit events.

Add an "audit_tty" attribute, inherited across fork ().  Data read from TTYs
by process with the attribute is sent to the audit subsystem by the kernel.
The audit netlink interface is extended to allow modifying the audit_tty
attribute, and to allow sending explanatory audit events from user-space (for
example, a shell might send an event containing the final command, after the
interactive command-line editing and history expansion is performed, which
might be difficult to decipher from the TTY input alone).

Because the "audit_tty" attribute is inherited across fork (), it would be set
e.g.  for sshd restarted within an audited session.  To prevent this, the
audit_tty attribute is cleared when a process with no open TTY file
descriptors (e.g.  after daemon startup) opens a TTY.

See https://www.redhat.com/archives/linux-audit/2007-June/msg00000.html for a
more detailed rationale document for an older version of this patch.

[akpm@linux-foundation.org: build fix]
Signed-off-by: Miloslav Trmac &lt;mitr@redhat.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: Paul Fulghum &lt;paulkf@microgate.com&gt;
Cc: Casey Schaufler &lt;casey@schaufler-ca.com&gt;
Cc: Steve Grubb &lt;sgrubb@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tty_io: Use kzalloc</title>
<updated>2007-07-16T16:05:43Z</updated>
<author>
<name>Jean Delvare</name>
</author>
<published>2007-07-16T06:40:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=506eb99a26e7af8b649faa135f648d1a2f1e4cdc'/>
<id>urn:sha1:506eb99a26e7af8b649faa135f648d1a2f1e4cdc</id>
<content type='text'>
Also remove needless casts.

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Acked-by: Alan Cox &lt;alan@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Prevent an O_NDELAY writer from blocking when a tty write is blocked by the tty atomic writer mutex</title>
<updated>2007-07-16T16:05:41Z</updated>
<author>
<name>Alan Cox</name>
</author>
<published>2007-07-16T06:39:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9c1729db3e6d738f872bcb090212af00473bf666'/>
<id>urn:sha1:9c1729db3e6d738f872bcb090212af00473bf666</id>
<content type='text'>
Without this a tty write could block if a previous blocking tty write was
in progress on the same tty and blocked by a line discipline or hardware
event.  Originally found and reported by Dave Johnson.

Signed-off-by: Alan Cox &lt;alan@redhat.com&gt;
Acked-by: Dave Johnson &lt;djohnson+linux-kernel@sw.starentnetworks.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tty: restore locked ioctl file op</title>
<updated>2007-06-16T20:16:15Z</updated>
<author>
<name>Paul Fulghum</name>
</author>
<published>2007-06-16T17:15:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38ad2ed08d89a4b830a03131fa73e4ef3e98d9f4'/>
<id>urn:sha1:38ad2ed08d89a4b830a03131fa73e4ef3e98d9f4</id>
<content type='text'>
Restore tty locked ioctl handler which was replaced with
an unlocked ioctl handler in hung_up_tty_fops by the patch:

commit e10cc1df1d2014f68a4bdcf73f6dd122c4561f94
Author: Paul Fulghum &lt;paulkf@microgate.com&gt;
Date:   Thu May 10 22:22:50 2007 -0700

    tty: add compat_ioctl

This was reported in:
[Bug 8473] New: Oops: 0010 [1] SMP

The bug is caused by switching to hung_up_tty_fops in do_tty_hangup.  An
ioctl call can be waiting on BLK after testing for existence of the locked
ioctl handler in the normal tty fops, but before calling the locked ioctl
handler.  If a hangup occurs at that point, the locked ioctl fop is NULL
and an oops occurs.

(akpm: we can remove my debugging code from do_ioctl() now, but it'll be OK to
do that for 2.6.23)

Signed-off-by: Paul Fulghum &lt;paulkf@microgate.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tty: fix leakage of -ERESTARTSYS to userland</title>
<updated>2007-06-01T15:18:29Z</updated>
<author>
<name>Oleg Nesterov</name>
</author>
<published>2007-06-01T07:46:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=040b6362d58fe9a344e053546c12bf821f6fce99'/>
<id>urn:sha1:040b6362d58fe9a344e053546c12bf821f6fce99</id>
<content type='text'>
Spotted by Satoru Takeuchi.

kill_pgrp(task_pgrp(current)) sends the signal to the current's thread
group, but can choose any sub-thread as a target for signal_wake_up().
This means that job_control() and tty_check_change() may return
-ERESTARTSYS without signal_pending().

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Satoru Takeuchi &lt;takeuchi_satoru@jp.fujitsu.com&gt;
Cc: Roland McGrath &lt;roland@redhat.com&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tty: flush flip buffer on ldisc input queue flush</title>
<updated>2007-05-12T17:55:39Z</updated>
<author>
<name>Paul Fulghum</name>
</author>
<published>2007-05-12T17:36:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c5c34d4862e18ef07c1276d233507f540fb5a532'/>
<id>urn:sha1:c5c34d4862e18ef07c1276d233507f540fb5a532</id>
<content type='text'>
Flush the tty flip buffer when the line discipline input queue is flushed,
including the user call tcflush(TCIFLUSH/TCIOFLUSH).  This prevents
unexpected stale data after a user application calls tcflush().

Signed-off-by: Alan Cox &lt;alan@redhat.com&gt;
Cc: Antonino Ingargiola &lt;tritemio@gmail.com&gt;
Signed-off-by: Paul Fulghum &lt;paulkf@microgate.com&gt;
Cc: Theodore Ts'o &lt;tytso@mit.edu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[TTY]: Export proc_clear_tty() to modulea.</title>
<updated>2007-05-12T04:39:23Z</updated>
<author>
<name>David S. Miller</name>
</author>
<published>2007-05-11T21:30:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7cac4ce59b3bc2b5c91b7e0cf4e6943e223076ec'/>
<id>urn:sha1:7cac4ce59b3bc2b5c91b7e0cf4e6943e223076ec</id>
<content type='text'>
A use was added to the solaris syscall module which
can be built modular.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>tty: add compat_ioctl</title>
<updated>2007-05-11T15:29:35Z</updated>
<author>
<name>Paul Fulghum</name>
</author>
<published>2007-05-11T05:22:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e10cc1df1d2014f68a4bdcf73f6dd122c4561f94'/>
<id>urn:sha1:e10cc1df1d2014f68a4bdcf73f6dd122c4561f94</id>
<content type='text'>
Add compat_ioctl method for tty code to allow processing of 32 bit ioctl
calls on 64 bit systems by tty core, tty drivers, and line disciplines.

Based on patch by Arnd Bergmann:
http://www.uwsg.iu.edu/hypermail/linux/kernel/0511.0/1732.html

[akpm@linux-foundation.org: make things static]
Signed-off-by: Paul Fulghum &lt;paulkf@microgate.com&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
