<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git, branch v2.6.16.49</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v2.6.16.49</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v2.6.16.49'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2007-04-22T22:59:58+00:00</updated>
<entry>
<title>Linux 2.6.16.49</title>
<updated>2007-04-22T22:59:58+00:00</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@stusta.de</email>
</author>
<published>2007-04-22T22:59:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7a715c633b9188def897f019f1969e4352925f43'/>
<id>urn:sha1:7a715c633b9188def897f019f1969e4352925f43</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Linux 2.6.16.49-rc1</title>
<updated>2007-04-20T22:20:44+00:00</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@stusta.de</email>
</author>
<published>2007-04-20T22:20:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eeceec454f81ac28ba97edf1386d5a40da072ff8'/>
<id>urn:sha1:eeceec454f81ac28ba97edf1386d5a40da072ff8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tty_io: fix race in master pty close/slave pty close path</title>
<updated>2007-04-20T22:18:01+00:00</updated>
<author>
<name>Aristeu Sergio Rozanski Filho</name>
<email>aris@ruivo.org</email>
</author>
<published>2007-04-20T22:18:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fec2411aa963fafcf17823b43c2379ba3d228cd8'/>
<id>urn:sha1:fec2411aa963fafcf17823b43c2379ba3d228cd8</id>
<content type='text'>
This patch fixes a possible race that leads to double freeing an idr index.
 When the master begin to close, release_dev() is called and then
pty_close() is called:

        if (tty-&gt;driver-&gt;close)
                tty-&gt;driver-&gt;close(tty, filp);

This is done without helding any locks other than BKL.  Inside pty_close(),
being a master close, the devpts entry will be removed:

#ifdef CONFIG_UNIX98_PTYS
                if (tty-&gt;driver == ptm_driver)
                        devpts_pty_kill(tty-&gt;index);
#endif

But devpts_pty_kill() will call get_node() that may sleep while waiting for
&amp;devpts_root-&gt;d_inode-&gt;i_sem.  When this happens and the slave is being
opened, tty_open() just found the driver and index:

        driver = get_tty_driver(device, &amp;index);
        if (!driver) {
                mutex_unlock(&amp;tty_mutex);
                return -ENODEV;
        }

This part of the code is already protected under tty_mute.  The problem is
that the slave close already got an index.  Then init_dev() is called and
blocks waiting for the same &amp;devpts_root-&gt;d_inode-&gt;i_sem.

When the master close resumes, it removes the devpts entry, and the
relation between idr index and the tty is gone.  The master then sleeps
waiting for the tty_mutex on release_dev().

Slave open resumes and found no tty for that index.  As result, a NULL tty
is returned and init_dev() doesn't flow to fast_track:

        /* check whether we're reopening an existing tty */
        if (driver-&gt;flags &amp; TTY_DRIVER_DEVPTS_MEM) {
                tty = devpts_get_tty(idx);
                if (tty &amp;&amp; driver-&gt;subtype == PTY_TYPE_MASTER)
                        tty = tty-&gt;link;
        } else {
                tty = driver-&gt;ttys[idx];
        }
        if (tty) goto fast_track;

The result of this, is that a new tty will be created and init_dev() returns
sucessfull. After returning, tty_mutex is dropped and master close may resume.

Master close finds it's the only use and both sides are closing, then releases
the tty and the index. At this point, the idr index is free, but slave still
has it.

Slave open then calls pty_open() and finds that tty-&gt;link-&gt;count is 0,
because there's no master and returns error.  Then tty_open() calls
release_dev() which executes without any warning, as it was a case of last
slave close when the master is already closed (master-&gt;count == 0,
slave-&gt;count == 1).  The tty is then released with the already released idr
index.

This normally would only issue a warning on idr_remove() but in case of a
customer's critical application, it's never too simple:

thread1: opens master, gets index X
thread1: begin closing master
thread2: begin opening slave with index X
thread1: finishes closing master, index X released
thread3: opens master, gets index X, just released
thread2: fails opening slave, releases index X         &lt;----
thread4: opens master, gets index X, init_dev() then find an already in use
         and healthy tty and fails

If no more indexes are released, ptmx_open() will keep failing, as the
first free index available is X, and it will make init_dev() fail because
you're trying to "reopen a master" which isn't valid.

The patch notices when this race happens and make init_dev() fail
imediately.  The init_dev() function is called with tty_mutex held, so it's
safe to continue with tty till the end of function because release_dev()
won't make any further changes without grabbing the tty_mutex.

Without the patch, on some machines it's possible get easily idr warnings
like this one:

idr_remove called for id=15 which is not allocated.
 [&lt;c02555b9&gt;] idr_remove+0x139/0x170
 [&lt;c02a1b62&gt;] release_mem+0x182/0x230
 [&lt;c02a28e7&gt;] release_dev+0x4b7/0x700
 [&lt;c02a0ea7&gt;] tty_ldisc_enable+0x27/0x30
 [&lt;c02a1e64&gt;] init_dev+0x254/0x580
 [&lt;c02a0d64&gt;] check_tty_count+0x14/0xb0
 [&lt;c02a4f05&gt;] tty_open+0x1c5/0x340
 [&lt;c02a4d40&gt;] tty_open+0x0/0x340
 [&lt;c017388f&gt;] chrdev_open+0xaf/0x180
 [&lt;c017c2ac&gt;] open_namei+0x8c/0x760
 [&lt;c01737e0&gt;] chrdev_open+0x0/0x180
 [&lt;c0167bc9&gt;] __dentry_open+0xc9/0x210
 [&lt;c0167e2c&gt;] do_filp_open+0x5c/0x70
 [&lt;c0167a91&gt;] get_unused_fd+0x61/0xd0
 [&lt;c0167e93&gt;] do_sys_open+0x53/0x100
 [&lt;c0167f97&gt;] sys_open+0x27/0x30
 [&lt;c010303b&gt;] syscall_call+0x7/0xb

using this test application available on:
 http://www.ruivo.org/~aris/pty_sodomizer.c

Signed-off-by: Aristeu Sergio Rozanski Filho &lt;aris@ruivo.org&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>elevator: move clearing of unplug flag earlier</title>
<updated>2007-04-20T22:13:30+00:00</updated>
<author>
<name>Linas Vepstas</name>
<email>linas@austin.ibm.com</email>
</author>
<published>2007-04-20T22:13:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=908991f13837d34a445fc313e44fd7b6dbb5c5c9'/>
<id>urn:sha1:908991f13837d34a445fc313e44fd7b6dbb5c5c9</id>
<content type='text'>
A flag was recently added to the elevator code to avoid
performing an unplug when reuests are being re-queued.
The goal of this flag was to avoid a deep recursion that
can occur when re-queueing requests after a SCSI device/host
reset.  See http://lkml.org/lkml/2006/5/17/254

However, that fix added the flag near the bottom of a case
statement, where an earlier break (in an if statement) could
transport one out of the case, without setting the flag.
This patch sets the flag earlier in the case statement.

I re-discovered the deep recursion recently during testing;
I was told that it was a known problem, and the fix to it was
in the kernel I was testing. Indeed it was ... but it didn't
fix the bug. With the patch below, I no longer see the bug.

Signed-off by: Linas Vepstas &lt;linas@austin.ibm.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@suse.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>start_kernel: test if irq's got enabled early, barf, and disable them again</title>
<updated>2007-04-20T22:10:28+00:00</updated>
<author>
<name>Ard van Breemen</name>
<email>ard@telegraafnet.nl</email>
</author>
<published>2007-04-20T22:10:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cfef930041a5dba4d3c8eb03d9d24fae9b129b08'/>
<id>urn:sha1:cfef930041a5dba4d3c8eb03d9d24fae9b129b08</id>
<content type='text'>
The calls made by parse_parms to other initialization code might enable
interrupts again way too early.

Having interrupts on this early can make systems PANIC when they initialize
the IRQ controllers (which happens later in the code).  This patch detects
that irq's are enabled again, barfs about it and disables them again as a
safety net.

[akpm@osdl.org: cleanups]
Signed-off-by: Ard van Breemen &lt;ard@telegraafnet.nl&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>[IrDA]: Correctly handling socket error</title>
<updated>2007-04-19T23:45:09+00:00</updated>
<author>
<name>Olaf Kirch</name>
<email>olaf.kirch@oracle.com</email>
</author>
<published>2007-04-19T23:45:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ae0199ba95ac7d5f45a565afb4adf8bb1e7ef59c'/>
<id>urn:sha1:ae0199ba95ac7d5f45a565afb4adf8bb1e7ef59c</id>
<content type='text'>
This patch fixes an oops first reported in mid 2006 - see
http://lkml.org/lkml/2006/8/29/358 The cause of this bug report is that
when an error is signalled on the socket, irda_recvmsg_stream returns
without removing a local wait_queue variable from the socket's sk_sleep
queue. This causes havoc further down the road.

In response to this problem, a patch was made that invoked sock_orphan on
the socket when receiving a disconnect indication. This is not a good fix,
as this sets sk_sleep to NULL, causing applications sleeping in recvmsg
(and other places) to oops.

Signed-off-by: Olaf Kirch &lt;olaf.kirch@oracle.com&gt;
Signed-off-by: Samuel Ortiz &lt;samuel@sortiz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>hwmon/w83627ehf: Fix the fan5 clock divider write</title>
<updated>2007-04-19T23:43:12+00:00</updated>
<author>
<name>Jean Delvare</name>
<email>khali@linux-fr.org</email>
</author>
<published>2007-04-19T23:43:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=17acc02c4df45426d62e5e31231a2312c361f107'/>
<id>urn:sha1:17acc02c4df45426d62e5e31231a2312c361f107</id>
<content type='text'>
Users have been complaining about the w83627ehf driver flooding their logs
with debug messages like:

w83627ehf 9191-0a10: Increasing fan 4 clock divider from 64 to 128

or:

w83627ehf 9191-0290: Increasing fan 4 clock divider from 4 to 8

The reason is that we failed to actually write the LSB of the encoded clock
divider value for that fan, causing the next read to report the same old value
again and again.

Additionally, the fan number was improperly reported, making the bug harder to
find.

Signed-off-by: Jean Delvare &lt;khali@linux-fr.org&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>[NET]: Fix UDP checksum issue in net poll mode.</title>
<updated>2007-04-19T23:40:19+00:00</updated>
<author>
<name>Aubrey Li</name>
<email>aubreylee@gmail.com</email>
</author>
<published>2007-04-19T23:40:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=691d4b9f4f4479edb4c3c63c7dbf5c5fa1ce0979'/>
<id>urn:sha1:691d4b9f4f4479edb4c3c63c7dbf5c5fa1ce0979</id>
<content type='text'>
In net poll mode, the current checksum function doesn't consider the
kind of packet which is padded to reach a specific minimum length. I
believe that's the problem causing my test case failed. The following
patch fixed this issue.

Signed-off-by: Aubrey Li &lt;aubreylee@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>[SPARC64]: Fix inline directive in pci_iommu.c</title>
<updated>2007-04-19T23:38:57+00:00</updated>
<author>
<name>Tom Callaway</name>
<email>tcallawa@redhat.com</email>
</author>
<published>2007-04-19T23:38:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f1e0381bf5d781ee6c03ec7ddaa91e950869e472'/>
<id>urn:sha1:f1e0381bf5d781ee6c03ec7ddaa91e950869e472</id>
<content type='text'>
While building a test kernel for the new esp driver (against
git-current), I hit this bug. Trivial fix, put the inline declaration
in the right place. :)

Signed-off-by: Tom Callaway &lt;tcallawa@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
<entry>
<title>[SPARC64]: Fix arg passing to compat_sys_ipc().</title>
<updated>2007-04-19T23:37:37+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2007-04-19T23:37:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=446941875919bdbae44c814c99256a18dd181f57'/>
<id>urn:sha1:446941875919bdbae44c814c99256a18dd181f57</id>
<content type='text'>
Do not sign extend args using the sys32_ipc stub, that is
buggy and unnecessary.

Based upon an excellent report by Mikael Pettersson.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
</entry>
</feed>
