<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux, branch v3.4.40</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.40</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.40'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-04-12T16:38:46Z</updated>
<entry>
<title>spinlocks and preemption points need to be at least compiler barriers</title>
<updated>2013-04-12T16:38:46Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-04-09T17:48:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a227904b82c591bf9531b9deac1e60fbe96abfed'/>
<id>urn:sha1:a227904b82c591bf9531b9deac1e60fbe96abfed</id>
<content type='text'>
commit 386afc91144b36b42117b0092893f15bc8798a80 upstream.

In UP and non-preempt respectively, the spinlocks and preemption
disable/enable points are stubbed out entirely, because there is no
regular code that can ever hit the kind of concurrency they are meant to
protect against.

However, while there is no regular code that can cause scheduling, we
_do_ end up having some exceptional (literally!) code that can do so,
and that we need to make sure does not ever get moved into the critical
region by the compiler.

In particular, get_user() and put_user() is generally implemented as
inline asm statements (even if the inline asm may then make a call
instruction to call out-of-line), and can obviously cause a page fault
and IO as a result.  If that inline asm has been scheduled into the
middle of a preemption-safe (or spinlock-protected) code region, we
obviously lose.

Now, admittedly this is *very* unlikely to actually ever happen, and
we've not seen examples of actual bugs related to this.  But partly
exactly because it's so hard to trigger and the resulting bug is so
subtle, we should be extra careful to get this right.

So make sure that even when preemption is disabled, and we don't have to
generate any actual *code* to explicitly tell the system that we are in
a preemption-disabled region, we need to at least tell the compiler not
to move things around the critical region.

This patch grew out of the same discussion that caused commits
79e5f05edcbf ("ARC: Add implicit compiler barrier to raw_local_irq*
functions") and 3e2e0d2c222b ("tile: comment assumption about
__insn_mtspr for &lt;asm/irqflags.h&gt;") to come about.

Note for stable: use discretion when/if applying this.  As mentioned,
this bug may never have actually bitten anybody, and gcc may never have
done the required code motion for it to possibly ever trigger in
practice.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>libata: Set max sector to 65535 for Slimtype DVD A DS8A8SH drive</title>
<updated>2013-04-12T16:38:44Z</updated>
<author>
<name>Shan Hai</name>
<email>shan.hai@windriver.com</email>
</author>
<published>2013-03-18T02:30:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=284aeebb312c2b2464673bf68b9a32e415b5145a'/>
<id>urn:sha1:284aeebb312c2b2464673bf68b9a32e415b5145a</id>
<content type='text'>
commit a32450e127fc6e5ca6d958ceb3cfea4d30a00846 upstream.

The Slimtype DVD A  DS8A8SH drive locks up when max sector is smaller than
65535, and the blow backtrace is observed on locking up:

INFO: task flush-8:32:1130 blocked for more than 120 seconds.
"echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
flush-8:32      D ffffffff8180cf60     0  1130      2 0x00000000
 ffff880273aef618 0000000000000046 0000000000000005 ffff880273aee000
 ffff880273aee000 ffff880273aeffd8 ffff880273aee010 ffff880273aee000
 ffff880273aeffd8 ffff880273aee000 ffff88026e842ea0 ffff880274a10000
Call Trace:
 [&lt;ffffffff8168fc2d&gt;] schedule+0x5d/0x70
 [&lt;ffffffff8168fccc&gt;] io_schedule+0x8c/0xd0
 [&lt;ffffffff81324461&gt;] get_request+0x731/0x7d0
 [&lt;ffffffff8133dc60&gt;] ? cfq_allow_merge+0x50/0x90
 [&lt;ffffffff81083aa0&gt;] ? wake_up_bit+0x40/0x40
 [&lt;ffffffff81320443&gt;] ? bio_attempt_back_merge+0x33/0x110
 [&lt;ffffffff813248ea&gt;] blk_queue_bio+0x23a/0x3f0
 [&lt;ffffffff81322176&gt;] generic_make_request+0xc6/0x120
 [&lt;ffffffff81322308&gt;] submit_bio+0x138/0x160
 [&lt;ffffffff811d7596&gt;] ? bio_alloc_bioset+0x96/0x120
 [&lt;ffffffff811d1f61&gt;] submit_bh+0x1f1/0x220
 [&lt;ffffffff811d48b8&gt;] __block_write_full_page+0x228/0x340
 [&lt;ffffffff811d3650&gt;] ? attach_nobh_buffers+0xc0/0xc0
 [&lt;ffffffff811d8960&gt;] ? I_BDEV+0x10/0x10
 [&lt;ffffffff811d8960&gt;] ? I_BDEV+0x10/0x10
 [&lt;ffffffff811d4ab6&gt;] block_write_full_page_endio+0xe6/0x100
 [&lt;ffffffff811d4ae5&gt;] block_write_full_page+0x15/0x20
 [&lt;ffffffff811d9268&gt;] blkdev_writepage+0x18/0x20
 [&lt;ffffffff81142527&gt;] __writepage+0x17/0x40
 [&lt;ffffffff811438ba&gt;] write_cache_pages+0x34a/0x4a0
 [&lt;ffffffff81142510&gt;] ? set_page_dirty+0x70/0x70
 [&lt;ffffffff81143a61&gt;] generic_writepages+0x51/0x80
 [&lt;ffffffff81143ab0&gt;] do_writepages+0x20/0x50
 [&lt;ffffffff811c9ed6&gt;] __writeback_single_inode+0xa6/0x2b0
 [&lt;ffffffff811ca861&gt;] writeback_sb_inodes+0x311/0x4d0
 [&lt;ffffffff811caaa6&gt;] __writeback_inodes_wb+0x86/0xd0
 [&lt;ffffffff811cad43&gt;] wb_writeback+0x1a3/0x330
 [&lt;ffffffff816916cf&gt;] ? _raw_spin_lock_irqsave+0x3f/0x50
 [&lt;ffffffff811b8362&gt;] ? get_nr_inodes+0x52/0x70
 [&lt;ffffffff811cb0ac&gt;] wb_do_writeback+0x1dc/0x260
 [&lt;ffffffff8168dd34&gt;] ? schedule_timeout+0x204/0x240
 [&lt;ffffffff811cb232&gt;] bdi_writeback_thread+0x102/0x2b0
 [&lt;ffffffff811cb130&gt;] ? wb_do_writeback+0x260/0x260
 [&lt;ffffffff81083550&gt;] kthread+0xc0/0xd0
 [&lt;ffffffff81083490&gt;] ? kthread_worker_fn+0x1b0/0x1b0
 [&lt;ffffffff8169a3ec&gt;] ret_from_fork+0x7c/0xb0
 [&lt;ffffffff81083490&gt;] ? kthread_worker_fn+0x1b0/0x1b0

 The above trace was triggered by
   "dd if=/dev/zero of=/dev/sr0 bs=2048 count=32768"

 It was previously working by accident, since another bug introduced
 by 4dce8ba94c7 (libata: Use 'bool' return value for ata_id_XXX) caused
 all drives to use maxsect=65535.

Signed-off-by: Shan Hai &lt;shan.hai@windriver.com&gt;
Signed-off-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>libata: Use integer return value for atapi_command_packet_set</title>
<updated>2013-04-12T16:38:44Z</updated>
<author>
<name>Shan Hai</name>
<email>shan.hai@windriver.com</email>
</author>
<published>2013-03-18T02:30:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=57b41f6193014b2a4a67c270dd77d801fd337d98'/>
<id>urn:sha1:57b41f6193014b2a4a67c270dd77d801fd337d98</id>
<content type='text'>
commit d8668fcb0b257d9fdcfbe5c172a99b8d85e1cd82 upstream.

The function returns type of ATAPI drives so it should return integer value.
The commit 4dce8ba94c7 (libata: Use 'bool' return value for ata_id_XXX) since
v2.6.39 changed the type of return value from int to bool, the change would
cause all of the ATAPI class drives to be treated as TYPE_TAPE and the
max_sectors of the drives to be set to 65535 because of the commit
f8d8e5799b7(libata: increase 128 KB / cmd limit for ATAPI tape drives), for the
function would return true for all ATAPI class drives and the TYPE_TAPE is
defined as 0x01.

Signed-off-by: Shan Hai &lt;shan.hai@windriver.com&gt;
Signed-off-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>net: fix *_DIAG_MAX constants</title>
<updated>2013-04-05T17:04:40Z</updated>
<author>
<name>Andrey Vagin</name>
<email>avagin@openvz.org</email>
</author>
<published>2013-03-21T16:33:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a9304844277ca08288b54df5ee9201c5ce3e4cbf'/>
<id>urn:sha1:a9304844277ca08288b54df5ee9201c5ce3e4cbf</id>
<content type='text'>
[ Upstream commit ae5fc98728c8bbbd6d7cab0b9781671fc4419c1b ]

Follow the common pattern and define *_DIAG_MAX like:

        [...]
        __XXX_DIAG_MAX,
};

Because everyone is used to do:

        struct nlattr *attrs[XXX_DIAG_MAX+1];

        nla_parse([...], XXX_DIAG_MAX, [...]

Reported-by: Thomas Graf &lt;tgraf@suug.ch&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Pavel Emelyanov &lt;xemul@parallels.com&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: "Paul E. McKenney" &lt;paulmck@linux.vnet.ibm.com&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Andrey Vagin &lt;avagin@openvz.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>thermal: shorten too long mcast group name</title>
<updated>2013-04-05T17:04:38Z</updated>
<author>
<name>Masatake YAMATO</name>
<email>yamato@redhat.com</email>
</author>
<published>2013-04-01T18:50:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b9f3bf1d0fe1e9ef11d1d607906138e9f84f7616'/>
<id>urn:sha1:b9f3bf1d0fe1e9ef11d1d607906138e9f84f7616</id>
<content type='text'>
[ Upstream commits 73214f5d9f33b79918b1f7babddd5c8af28dd23d
  and f1e79e208076ffe7bad97158275f1c572c04f5c7, the latter
  adds an assertion to genetlink to prevent this from happening
  again in the future. ]

The original name is too long.

Signed-off-by: Masatake YAMATO &lt;yamato@redhat.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>exec: use -ELOOP for max recursion depth</title>
<updated>2013-03-28T19:12:28Z</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2012-12-18T00:03:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=023eae6de094c527f85c5fc3e9a8a364af56b1af'/>
<id>urn:sha1:023eae6de094c527f85c5fc3e9a8a364af56b1af</id>
<content type='text'>
commit d740269867021faf4ce38a449353d2b986c34a67 upstream.

To avoid an explosion of request_module calls on a chain of abusive
scripts, fail maximum recursion with -ELOOP instead of -ENOEXEC. As soon
as maximum recursion depth is hit, the error will fail all the way back
up the chain, aborting immediately.

This also has the side-effect of stopping the user's shell from attempting
to reexecute the top-level file as a shell script. As seen in the
dash source:

        if (cmd != path_bshell &amp;&amp; errno == ENOEXEC) {
                *argv-- = cmd;
                *argv = cmd = path_bshell;
                goto repeat;
        }

The above logic was designed for running scripts automatically that lacked
the "#!" header, not to re-try failed recursion. On a legitimate -ENOEXEC,
things continue to behave as the shell expects.

Additionally, when tracking recursion, the binfmt handlers should not be
involved. The recursion being tracked is the depth of calls through
search_binary_handler(), so that function should be exclusively responsible
for tracking the depth.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: halfdog &lt;me@halfdog.net&gt;
Cc: P J P &lt;ppandit@redhat.com&gt;
Cc: Alexander Viro &lt;viro@zeniv.linux.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;
Cc: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tcp: fix skb_availroom()</title>
<updated>2013-03-28T19:11:53Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2013-03-14T05:40:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b6da578e2a610a64e89f2a983f7675eb301c5d35'/>
<id>urn:sha1:b6da578e2a610a64e89f2a983f7675eb301c5d35</id>
<content type='text'>
[ Upstream commit 16fad69cfe4adbbfa813de516757b87bcae36d93 ]

Chrome OS team reported a crash on a Pixel ChromeBook in TCP stack :

https://code.google.com/p/chromium/issues/detail?id=182056

commit a21d45726acac (tcp: avoid order-1 allocations on wifi and tx
path) did a poor choice adding an 'avail_size' field to skb, while
what we really needed was a 'reserved_tailroom' one.

It would have avoided commit 22b4a4f22da (tcp: fix retransmit of
partially acked frames) and this commit.

Crash occurs because skb_split() is not aware of the 'avail_size'
management (and should not be aware)

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reported-by: Mukesh Agrawal &lt;quiche@chromium.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>perf,x86: fix link failure for non-Intel configs</title>
<updated>2013-03-20T20:05:00Z</updated>
<author>
<name>David Rientjes</name>
<email>rientjes@google.com</email>
</author>
<published>2013-03-17T22:49:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6bf083ffc825244992274a23017655caee8e4c58'/>
<id>urn:sha1:6bf083ffc825244992274a23017655caee8e4c58</id>
<content type='text'>
commit 6c4d3bc99b3341067775efd4d9d13cc8e655fd7c upstream.

Commit 1d9d8639c063 ("perf,x86: fix kernel crash with PEBS/BTS after
suspend/resume") introduces a link failure since
perf_restore_debug_store() is only defined for CONFIG_CPU_SUP_INTEL:

	arch/x86/power/built-in.o: In function `restore_processor_state':
	(.text+0x45c): undefined reference to `perf_restore_debug_store'

Fix it by defining the dummy function appropriately.

Signed-off-by: David Rientjes &lt;rientjes@google.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf,x86: fix kernel crash with PEBS/BTS after suspend/resume</title>
<updated>2013-03-20T20:04:59Z</updated>
<author>
<name>Stephane Eranian</name>
<email>eranian@google.com</email>
</author>
<published>2013-03-15T13:26:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9a9b01c04ef4b844f64bbf36987f918e64e304a2'/>
<id>urn:sha1:9a9b01c04ef4b844f64bbf36987f918e64e304a2</id>
<content type='text'>
commit 1d9d8639c063caf6efc2447f5f26aa637f844ff6 upstream.

This patch fixes a kernel crash when using precise sampling (PEBS)
after a suspend/resume. Turns out the CPU notifier code is not invoked
on CPU0 (BP). Therefore, the DS_AREA (used by PEBS) is not restored properly
by the kernel and keeps it power-on/resume value of 0 causing any PEBS
measurement to crash when running on CPU0.

The workaround is to add a hook in the actual resume code to restore
the DS Area MSR value. It is invoked for all CPUS. So for all but CPU0,
the DS_AREA will be restored twice but this is harmless.

Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Stephane Eranian &lt;eranian@google.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>pstore: Avoid deadlock in panic and emergency-restart path</title>
<updated>2013-03-03T22:06:43Z</updated>
<author>
<name>Seiji Aguchi</name>
<email>seiji.aguchi@hds.com</email>
</author>
<published>2013-01-11T18:09:41Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=68412b1718c488e58783d1c576d0aeb34012092d'/>
<id>urn:sha1:68412b1718c488e58783d1c576d0aeb34012092d</id>
<content type='text'>
commit 9f244e9cfd70c7c0f82d3c92ce772ab2a92d9f64 upstream.

[Issue]

When pstore is in panic and emergency-restart paths, it may be blocked
in those paths because it simply takes spin_lock.

This is an example scenario which pstore may hang up in a panic path:

 - cpuA grabs psinfo-&gt;buf_lock
 - cpuB panics and calls smp_send_stop
 - smp_send_stop sends IRQ to cpuA
 - after 1 second, cpuB gives up on cpuA and sends an NMI instead
 - cpuA is now in an NMI handler while still holding buf_lock
 - cpuB is deadlocked

This case may happen if a firmware has a bug and
cpuA is stuck talking with it more than one second.

Also, this is a similar scenario in an emergency-restart path:

 - cpuA grabs psinfo-&gt;buf_lock and stucks in a firmware
 - cpuB kicks emergency-restart via either sysrq-b or hangcheck timer.
   And then, cpuB is deadlocked by taking psinfo-&gt;buf_lock again.

[Solution]

This patch avoids the deadlocking issues in both panic and emergency_restart
paths by introducing a function, is_non_blocking_path(), to check if a cpu
can be blocked in current path.

With this patch, pstore is not blocked even if another cpu has
taken a spin_lock, in those paths by changing from spin_lock_irqsave
to spin_trylock_irqsave.

In addition, according to a comment of emergency_restart() in kernel/sys.c,
spin_lock shouldn't be taken in an emergency_restart path to avoid
deadlock. This patch fits the comment below.

&lt;snip&gt;
/**
 *      emergency_restart - reboot the system
 *
 *      Without shutting down any hardware or taking any locks
 *      reboot the system.  This is called when we know we are in
 *      trouble so this is our best effort to reboot.  This is
 *      safe to call in interrupt context.
 */
void emergency_restart(void)
&lt;snip&gt;

Signed-off-by: Seiji Aguchi &lt;seiji.aguchi@hds.com&gt;
Acked-by: Don Zickus &lt;dzickus@redhat.com&gt;
Signed-off-by: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: CAI Qian &lt;caiqian@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
