<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tty, branch v2.6.37</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=v2.6.37</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.37'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2010-12-16T21:03:13Z</updated>
<entry>
<title>n_gsm: gsm_data_alloc buffer allocation could fail and it is not being checked</title>
<updated>2010-12-16T21:03:13Z</updated>
<author>
<name>Ken Mills</name>
<email>ken.k.mills@intel.com</email>
</author>
<published>2010-12-13T15:28:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=093d804611b9a38fe59753b37c29f840518406a9'/>
<id>urn:sha1:093d804611b9a38fe59753b37c29f840518406a9</id>
<content type='text'>
gsm_data_alloc buffer allocation could fail and it is not being checked.

Add check for allocated buffer and return if the buffer allocation
fails.

Signed-off-by: Ken Mills &lt;ken.k.mills@intel.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>n_gsm: Fix message length handling when building header</title>
<updated>2010-12-16T21:03:12Z</updated>
<author>
<name>Ken Mills</name>
<email>ken.k.mills@intel.com</email>
</author>
<published>2010-12-13T15:27:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=be7a7411d63ccad165d66fe8e0b11b2ee336159b'/>
<id>urn:sha1:be7a7411d63ccad165d66fe8e0b11b2ee336159b</id>
<content type='text'>
Fix message length handling when building header

When the message length is greater than 127, the length field in the header
is built incorrectly. According to the spec, when the length is less than 128
the length field is a single byte formatted as: bbbbbbb1. When it is greater
than 127 then the field is two bytes of the format: bbbbbbb0 bbbbbbbb.

Signed-off-by: Ken Mills &lt;ken.k.mills@intel.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6</title>
<updated>2010-12-02T20:58:16Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-12-02T20:58:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eed5ee1a3ab3020168cd67fdde2500452b0628c9'/>
<id>urn:sha1:eed5ee1a3ab3020168cd67fdde2500452b0628c9</id>
<content type='text'>
* 'tty-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6:
  serial: mfd: adjust the baud rate setting
  TTY: open/hangup race fixup
  TTY: don't allow reopen when ldisc is changing
  NET: wan/x25, fix ldisc-&gt;open retval
  TTY: ldisc, fix open flag handling
  serial8250: Mark console as CON_ANYTIME
</content>
</entry>
<entry>
<title>TTY: open/hangup race fixup</title>
<updated>2010-11-29T22:52:48Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2010-11-29T09:16:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=acfa747baf73922021a047f2d87a2d866f5dbab5'/>
<id>urn:sha1:acfa747baf73922021a047f2d87a2d866f5dbab5</id>
<content type='text'>
Like in the "TTY: don't allow reopen when ldisc is changing" patch,
this one fixes a TTY WARNING as described in the option 1) there:
1) __tty_hangup from tty_ldisc_hangup to tty_ldisc_enable. During this
section tty_lock is held. However tty_lock is temporarily dropped in
the middle of the function by tty_ldisc_hangup.

The fix is to introduce a new flag which we set during the unlocked
window and check it in tty_reopen too. The flag is TTY_HUPPING and is
cleared after TTY_HUPPED is set.

While at it, remove duplicate TTY_HUPPED set_bit. The one after
calling ops-&gt;hangup seems to be more correct. But anyway, we hold
tty_lock, so there should be no difference.

Also document the function it does that kind of crap.

Nicely reproducible with two forked children:
static void do_work(const char *tty)
{
	if (signal(SIGHUP, SIG_IGN) == SIG_ERR) exit(1);
	setsid();
	while (1) {
		int fd = open(tty, O_RDWR|O_NOCTTY);
		if (fd &lt; 0) continue;
		if (ioctl(fd, TIOCSCTTY)) continue;
		if (vhangup()) continue;
		close(fd);
	}
	exit(0);
}

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Reported-by: &lt;Valdis.Kletnieks@vt.edu&gt;
Reported-by: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>TTY: don't allow reopen when ldisc is changing</title>
<updated>2010-11-29T22:52:48Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2010-11-29T09:16:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e2efafbf139d2bfdfe96f2901f03189fecd172e4'/>
<id>urn:sha1:e2efafbf139d2bfdfe96f2901f03189fecd172e4</id>
<content type='text'>
There are many WARNINGs like the following reported nowadays:
WARNING: at drivers/tty/tty_io.c:1331 tty_open+0x2a2/0x49a()
Hardware name: Latitude E6500
Modules linked in:
Pid: 1207, comm: plymouthd Not tainted 2.6.37-rc3-mmotm1123 #3
Call Trace:
 [&lt;ffffffff8103b189&gt;] warn_slowpath_common+0x80/0x98
 [&lt;ffffffff8103b1b6&gt;] warn_slowpath_null+0x15/0x17
 [&lt;ffffffff8128a3ab&gt;] tty_open+0x2a2/0x49a
 [&lt;ffffffff810fd53f&gt;] chrdev_open+0x11d/0x146
...

This means tty_reopen is called without TTY_LDISC set. For further
considerations, note tty_lock is held in tty_open. TTY_LDISC is cleared in:
1) __tty_hangup from tty_ldisc_hangup to tty_ldisc_enable. During this
section tty_lock is held. However tty_lock is temporarily dropped in
the middle of the function by tty_ldisc_hangup.

2) tty_release via tty_ldisc_release till the end of tty existence. If
tty-&gt;count &lt;= 1, tty_lock is taken, TTY_CLOSING bit set and then
tty_ldisc_release called. tty_reopen checks TTY_CLOSING before checking
TTY_LDISC.

3) tty_set_ldisc from tty_ldisc_halt to tty_ldisc_enable. We:
   * take tty_lock, set TTY_LDISC_CHANGING, put tty_lock
   * call tty_ldisc_halt (clear TTY_LDISC), tty_lock is _not_ held
   * do some other work
   * take tty_lock, call tty_ldisc_enable (set TTY_LDISC), put
     tty_lock

I cannot see how 2) can be a problem, as there I see no race. OTOH, 1)
and 3) can happen without problems. This patch the case 3) by checking
TTY_LDISC_CHANGING along with TTY_CLOSING in tty_reopen. 1) will be
fixed in the following patch.

Nicely reproducible with two processes:
while (1) {
	fd = open("/dev/ttyS1", O_RDWR);
	if (fd &lt; 0) {
		warn("open");
		continue;
	}
	close(fd);
}
--------
while (1) {
        fd = open("/dev/ttyS1", O_RDWR);
        ld1 = 0; ld2 = 2;
        while (1) {
                ioctl(fd, TIOCSETD, &amp;ld1);
                ioctl(fd, TIOCSETD, &amp;ld2);
        }
        close(fd);
}

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Reported-by: &lt;Valdis.Kletnieks@vt.edu&gt;
Cc: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>TTY: ldisc, fix open flag handling</title>
<updated>2010-11-29T22:51:54Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2010-11-24T23:27:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f90cfc505d613f4faf096e0d84ffe99208057d9'/>
<id>urn:sha1:7f90cfc505d613f4faf096e0d84ffe99208057d9</id>
<content type='text'>
When a concrete ldisc open fails in tty_ldisc_open, we forget to clear
TTY_LDISC_OPEN. This causes a false warning on the next ldisc open:
WARNING: at drivers/char/tty_ldisc.c:445 tty_ldisc_open+0x26/0x38()
Hardware name: System Product Name
Modules linked in: ...
Pid: 5251, comm: a.out Tainted: G        W  2.6.32-5-686 #1
Call Trace:
 [&lt;c1030321&gt;] ? warn_slowpath_common+0x5e/0x8a
 [&lt;c1030357&gt;] ? warn_slowpath_null+0xa/0xc
 [&lt;c119311c&gt;] ? tty_ldisc_open+0x26/0x38
 [&lt;c11936c5&gt;] ? tty_set_ldisc+0x218/0x304
...

So clear the bit when failing...

Introduced in c65c9bc3efa (tty: rewrite the ldisc locking) back in
2.6.31-rc1.

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Alan Cox &lt;alan@linux.intel.com&gt;
Reported-by: Sergey Lapin &lt;slapin@ossfans.org&gt;
Tested-by: Sergey Lapin &lt;slapin@ossfans.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input</title>
<updated>2010-11-19T18:31:04Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-11-19T18:31:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=864ee6cb22fd64c1f4fba8ea3f390ffd8816b563'/>
<id>urn:sha1:864ee6cb22fd64c1f4fba8ea3f390ffd8816b563</id>
<content type='text'>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: fix typo in keycode validation supporting large scancodes
  Input: aiptek - tighten up permissions on sysfs attributes
  Input: sysrq - pass along lone Alt + SysRq
</content>
</entry>
<entry>
<title>n_gsm: Fix length handling</title>
<updated>2010-11-11T19:06:09Z</updated>
<author>
<name>Ken Mills</name>
<email>ken.k.mills@intel.com</email>
</author>
<published>2010-11-04T15:16:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=40e3465db2cffd64e069ca82ee981025554bc159'/>
<id>urn:sha1:40e3465db2cffd64e069ca82ee981025554bc159</id>
<content type='text'>
If the mux is configured with a large mru/mtu the existing code gets the
byte ordering wrong for the header.

Signed-off-by: Ken Mills &lt;ken.k.mills@intel.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>n_gsm: Copy n2 over when configuring via ioctl interface</title>
<updated>2010-11-11T19:06:08Z</updated>
<author>
<name>Ken Mills</name>
<email>ken.k.mills@intel.com</email>
</author>
<published>2010-11-04T15:16:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=820e62ef3d39ba9414dd9b87dba2eedd7e403e53'/>
<id>urn:sha1:820e62ef3d39ba9414dd9b87dba2eedd7e403e53</id>
<content type='text'>
The n2 field is settable but didn't get propogated

Signed-off-by: Ken Mills &lt;ken.k.mills@intel.com&gt;
Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>vcs: make proper usage of the poll flags</title>
<updated>2010-11-11T18:51:35Z</updated>
<author>
<name>Nicolas Pitre</name>
<email>nicolas.pitre@canonical.com</email>
</author>
<published>2010-11-10T06:33:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=47c344d0bd290e04c57eefdb0a721726e53bb57e'/>
<id>urn:sha1:47c344d0bd290e04c57eefdb0a721726e53bb57e</id>
<content type='text'>
Kay Sievers pointed out that usage of POLLIN is well defined by POSIX,
and the current usage here doesn't follow that definition.  So let's
duplicate the same semantics as implemented by sysfs_poll() instead.

Signed-off-by: Nicolas Pitre &lt;nicolas.pitre@canonical.com&gt;
Acked-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
</feed>
