<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel, branch v2.6.27.47</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>clockevent: Prevent dead lock on clockevents_lock</title>
<updated>2010-05-26T21:27:07+00:00</updated>
<author>
<name>Suresh Siddha</name>
<email>suresh.b.siddha@intel.com</email>
</author>
<published>2010-04-22T09:47:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=843447c62b771a9ad12f0e7f4a791804b4cc99f5'/>
<id>843447c62b771a9ad12f0e7f4a791804b4cc99f5</id>
<content type='text'>
This is a merge of two mainline commits, intended
for stable@kernel.org submission for 2.6.27 kernel.

commit f833bab87fca5c3ce13778421b1365845843b976
and

commit 918aae42aa9b611a3663b16ae849fdedc67c2292
Changelog of both:

    Currently clockevents_notify() is called with interrupts enabled at
    some places and interrupts disabled at some other places.

    This results in a deadlock in this scenario.

    cpu A holds clockevents_lock in clockevents_notify() with irqs enabled
    cpu B waits for clockevents_lock in clockevents_notify() with irqs disabled
    cpu C doing set_mtrr() which will try to rendezvous of all the cpus.

    This will result in C and A come to the rendezvous point and waiting
    for B. B is stuck forever waiting for the spinlock and thus not
    reaching the rendezvous point.

    Fix the clockevents code so that clockevents_lock is taken with
    interrupts disabled and thus avoid the above deadlock.

    Also call lapic_timer_propagate_broadcast() on the destination cpu so
    that we avoid calling smp_call_function() in the clockevents notifier
    chain.

    This issue left us wondering if we need to change the MTRR rendezvous
    logic to use stop machine logic (instead of smp_call_function) or add
    a check in spinlock debug code to see if there are other spinlocks
    which gets taken under both interrupts enabled/disabled conditions.

    Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
    Cc: "Brown Len" &lt;len.brown@intel.com&gt;
    Cc: stable@kernel.org
    LKML-Reference: &lt;1250544899.2709.210.camel@sbs-t61.sc.intel.com&gt;
    Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

    I got following warning on ia64 box:
      In function 'acpi_processor_power_verify':
      642: warning: passing argument 2 of 'smp_call_function_single' from
      incompatible pointer type

    This smp_call_function_single() was introduced by a commit
    f833bab87fca5c3ce13778421b1365845843b976:

    The problem is that the lapic_timer_propagate_broadcast() has 2 versions:
    One is real code that modified in the above commit, and the other is NOP
    code that used when !ARCH_APICTIMER_STOPS_ON_C3:

      static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) { }

    So I got warning because of !ARCH_APICTIMER_STOPS_ON_C3.

    We really want to do nothing here on !ARCH_APICTIMER_STOPS_ON_C3, so
    modify lapic_timer_propagate_broadcast() of real version to use
    smp_call_function_single() in it.

    Signed-off-by: Hidetoshi Seto &lt;seto.hidetoshi@jp.fujitsu.com&gt;
    Acked-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
    Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;

Signed-off-by: Thomas Renninger &lt;trenn@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a merge of two mainline commits, intended
for stable@kernel.org submission for 2.6.27 kernel.

commit f833bab87fca5c3ce13778421b1365845843b976
and

commit 918aae42aa9b611a3663b16ae849fdedc67c2292
Changelog of both:

    Currently clockevents_notify() is called with interrupts enabled at
    some places and interrupts disabled at some other places.

    This results in a deadlock in this scenario.

    cpu A holds clockevents_lock in clockevents_notify() with irqs enabled
    cpu B waits for clockevents_lock in clockevents_notify() with irqs disabled
    cpu C doing set_mtrr() which will try to rendezvous of all the cpus.

    This will result in C and A come to the rendezvous point and waiting
    for B. B is stuck forever waiting for the spinlock and thus not
    reaching the rendezvous point.

    Fix the clockevents code so that clockevents_lock is taken with
    interrupts disabled and thus avoid the above deadlock.

    Also call lapic_timer_propagate_broadcast() on the destination cpu so
    that we avoid calling smp_call_function() in the clockevents notifier
    chain.

    This issue left us wondering if we need to change the MTRR rendezvous
    logic to use stop machine logic (instead of smp_call_function) or add
    a check in spinlock debug code to see if there are other spinlocks
    which gets taken under both interrupts enabled/disabled conditions.

    Signed-off-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
    Cc: "Brown Len" &lt;len.brown@intel.com&gt;
    Cc: stable@kernel.org
    LKML-Reference: &lt;1250544899.2709.210.camel@sbs-t61.sc.intel.com&gt;
    Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;

    I got following warning on ia64 box:
      In function 'acpi_processor_power_verify':
      642: warning: passing argument 2 of 'smp_call_function_single' from
      incompatible pointer type

    This smp_call_function_single() was introduced by a commit
    f833bab87fca5c3ce13778421b1365845843b976:

    The problem is that the lapic_timer_propagate_broadcast() has 2 versions:
    One is real code that modified in the above commit, and the other is NOP
    code that used when !ARCH_APICTIMER_STOPS_ON_C3:

      static void lapic_timer_propagate_broadcast(struct acpi_processor *pr) { }

    So I got warning because of !ARCH_APICTIMER_STOPS_ON_C3.

    We really want to do nothing here on !ARCH_APICTIMER_STOPS_ON_C3, so
    modify lapic_timer_propagate_broadcast() of real version to use
    smp_call_function_single() in it.

    Signed-off-by: Hidetoshi Seto &lt;seto.hidetoshi@jp.fujitsu.com&gt;
    Acked-by: Suresh Siddha &lt;suresh.b.siddha@intel.com&gt;
    Signed-off-by: Len Brown &lt;len.brown@intel.com&gt;

Signed-off-by: Thomas Renninger &lt;trenn@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>trace: Fix inappropriate substraction on tracing_pages_allocated in trace_free_page()</title>
<updated>2010-05-26T21:27:07+00:00</updated>
<author>
<name>Wang Sheng-Hui</name>
<email>crosslonelyover@gmail.com</email>
</author>
<published>2010-04-13T13:04:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0851f4563b9e0770d4b3c071e605cb5e150c6ed3'/>
<id>0851f4563b9e0770d4b3c071e605cb5e150c6ed3</id>
<content type='text'>
[No matching upstream git commit id as it was fixed differently due to a
rewrite of the tracing code there.]

For normal case, the code in trace_free_page() do once more substraction
on tracing_pages_allocated, but for CONFIG_TRACER_MAX_TRACE  it doesn't
take the freed page into account. That's not consistent with
trace_alloc_page().  Well, for there are no message related with this,
so we cannot observe its incorrect state when the kernel doesn't define
"CONFIG_TRACER_MAX_TRACE". If you add some pr_info() as
trace_alloc_page(), you may notice it.

Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Wang Sheng-Hui &lt;crosslonelyover@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[No matching upstream git commit id as it was fixed differently due to a
rewrite of the tracing code there.]

For normal case, the code in trace_free_page() do once more substraction
on tracing_pages_allocated, but for CONFIG_TRACER_MAX_TRACE  it doesn't
take the freed page into account. That's not consistent with
trace_alloc_page().  Well, for there are no message related with this,
so we cannot observe its incorrect state when the kernel doesn't define
"CONFIG_TRACER_MAX_TRACE". If you add some pr_info() as
trace_alloc_page(), you may notice it.

Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Wang Sheng-Hui &lt;crosslonelyover@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>sched: wakeup preempt when small overlap</title>
<updated>2010-04-01T22:52:21+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-09-20T21:38:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ecfb7fb9b13c617447a7f6b5925da26798c1a8a1'/>
<id>ecfb7fb9b13c617447a7f6b5925da26798c1a8a1</id>
<content type='text'>
commit 15afe09bf496ae10c989e1a375a6b5da7bd3e16e upstream.

Lin Ming reported a 10% OLTP regression against 2.6.27-rc4.

The difference seems to come from different preemption agressiveness,
which affects the cache footprint of the workload and its effective
cache trashing.

Aggresively preempt a task if its avg overlap is very small, this should
avoid the task going to sleep and find it still running when we schedule
back to it - saving a wakeup.

Reported-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 15afe09bf496ae10c989e1a375a6b5da7bd3e16e upstream.

Lin Ming reported a 10% OLTP regression against 2.6.27-rc4.

The difference seems to come from different preemption agressiveness,
which affects the cache footprint of the workload and its effective
cache trashing.

Aggresively preempt a task if its avg overlap is very small, this should
avoid the task going to sleep and find it still running when we schedule
back to it - saving a wakeup.

Reported-by: Lin Ming &lt;ming.m.lin@intel.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>printk: robustify printk, fix #2</title>
<updated>2010-04-01T22:52:17+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-08-20T07:31:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4594467f733524ec6ef31648b8f5b7fce1856852'/>
<id>4594467f733524ec6ef31648b8f5b7fce1856852</id>
<content type='text'>
commit fa33507a22623b3bd543b15a21c362cf364b6cff upstream.

Dmitry Adamushko reported:

&gt; [*] btw., with DEBUG being enabled, pr_debug() generates [1] when
&gt; debug_smp_processor_id() is used (CONFIG_DEBUG_PREEMPT).
&gt;
&gt; the problem seems to be caused by the following commit:
&gt; commit b845b517b5e3706a3729f6ea83b88ab85f0725b0
&gt; Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
&gt; Date:   Fri Aug 8 21:47:09 2008 +0200
&gt;
&gt;     printk: robustify printk
&gt;
&gt;
&gt; wake_up_klogd() -&gt; __get_cpu_var() -&gt; smp_processor_id()
&gt;
&gt; and that's being called from release_console_sem() which is, in turn,
&gt; said to be "may be called from any context" [2]
&gt;
&gt; and in this case, it seems to be called from some non-preemptible
&gt; context (although, it can't be printk()...
&gt; although, I haven't looked carefully yet).
&gt;
&gt; Provided [2], __get_cpu_var() is perhaps not the right solution there.
&gt;
&gt;
&gt; [1]
&gt;
&gt; [ 7697.942005] BUG: using smp_processor_id() in preemptible [00000000] code: syslogd/3542
&gt; [ 7697.942005] caller is wake_up_klogd+0x1b/0x50
&gt; [ 7697.942005] Pid: 3542, comm: syslogd Not tainted 2.6.27-rc3-tip-git #2
&gt; [ 7697.942005] Call Trace:
&gt; [ 7697.942005]  [&lt;ffffffff8036b398&gt;] debug_smp_processor_id+0xe8/0xf0
&gt; [ 7697.942005]  [&lt;ffffffff80239d3b&gt;] wake_up_klogd+0x1b/0x50
&gt; [ 7697.942005]  [&lt;ffffffff8023a047&gt;] release_console_sem+0x1e7/0x200
&gt; [ 7697.942005]  [&lt;ffffffff803c0f17&gt;] do_con_write+0xb7/0x1f30
&gt; [ 7697.942005]  [&lt;ffffffff8020d920&gt;] ? show_trace+0x10/0x20
&gt; [ 7697.942005]  [&lt;ffffffff8020dc42&gt;] ? dump_stack+0x72/0x80
&gt; [ 7697.942005]  [&lt;ffffffff8036392d&gt;] ? __ratelimit+0xbd/0xe0
&gt; [ 7697.942005]  [&lt;ffffffff8036b398&gt;] ? debug_smp_processor_id+0xe8/0xf0
&gt; [ 7697.942005]  [&lt;ffffffff80239d3b&gt;] ? wake_up_klogd+0x1b/0x50
&gt; [ 7697.942005]  [&lt;ffffffff8023a047&gt;] ? release_console_sem+0x1e7/0x200
&gt; [ 7697.942005]  [&lt;ffffffff803c2de9&gt;] con_write+0x19/0x30
&gt; [ 7697.942005]  [&lt;ffffffff803b37b6&gt;] write_chan+0x276/0x3c0
&gt; [ 7697.942005]  [&lt;ffffffff80232b20&gt;] ? default_wake_function+0x0/0x10
&gt; [ 7697.942005]  [&lt;ffffffff804cb872&gt;] ? _spin_lock_irqsave+0x22/0x50
&gt; [ 7697.942005]  [&lt;ffffffff803b1334&gt;] tty_write+0x194/0x260
&gt; [ 7697.942005]  [&lt;ffffffff803b3540&gt;] ? write_chan+0x0/0x3c0
&gt; [ 7697.942005]  [&lt;ffffffff803b14a4&gt;] redirected_tty_write+0xa4/0xb0
&gt; [ 7697.942005]  [&lt;ffffffff803b1400&gt;] ? redirected_tty_write+0x0/0xb0
&gt; [ 7697.942005]  [&lt;ffffffff802a88c2&gt;] do_loop_readv_writev+0x52/0x80
&gt; [ 7697.942005]  [&lt;ffffffff802a939d&gt;] do_readv_writev+0x1bd/0x1d0
&gt; [ 7697.942005]  [&lt;ffffffff802a93e9&gt;] vfs_writev+0x39/0x60
&gt; [ 7697.942005]  [&lt;ffffffff802a9870&gt;] sys_writev+0x50/0x90
&gt; [ 7697.942005]  [&lt;ffffffff8020bb3b&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Reported-by: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit fa33507a22623b3bd543b15a21c362cf364b6cff upstream.

Dmitry Adamushko reported:

&gt; [*] btw., with DEBUG being enabled, pr_debug() generates [1] when
&gt; debug_smp_processor_id() is used (CONFIG_DEBUG_PREEMPT).
&gt;
&gt; the problem seems to be caused by the following commit:
&gt; commit b845b517b5e3706a3729f6ea83b88ab85f0725b0
&gt; Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
&gt; Date:   Fri Aug 8 21:47:09 2008 +0200
&gt;
&gt;     printk: robustify printk
&gt;
&gt;
&gt; wake_up_klogd() -&gt; __get_cpu_var() -&gt; smp_processor_id()
&gt;
&gt; and that's being called from release_console_sem() which is, in turn,
&gt; said to be "may be called from any context" [2]
&gt;
&gt; and in this case, it seems to be called from some non-preemptible
&gt; context (although, it can't be printk()...
&gt; although, I haven't looked carefully yet).
&gt;
&gt; Provided [2], __get_cpu_var() is perhaps not the right solution there.
&gt;
&gt;
&gt; [1]
&gt;
&gt; [ 7697.942005] BUG: using smp_processor_id() in preemptible [00000000] code: syslogd/3542
&gt; [ 7697.942005] caller is wake_up_klogd+0x1b/0x50
&gt; [ 7697.942005] Pid: 3542, comm: syslogd Not tainted 2.6.27-rc3-tip-git #2
&gt; [ 7697.942005] Call Trace:
&gt; [ 7697.942005]  [&lt;ffffffff8036b398&gt;] debug_smp_processor_id+0xe8/0xf0
&gt; [ 7697.942005]  [&lt;ffffffff80239d3b&gt;] wake_up_klogd+0x1b/0x50
&gt; [ 7697.942005]  [&lt;ffffffff8023a047&gt;] release_console_sem+0x1e7/0x200
&gt; [ 7697.942005]  [&lt;ffffffff803c0f17&gt;] do_con_write+0xb7/0x1f30
&gt; [ 7697.942005]  [&lt;ffffffff8020d920&gt;] ? show_trace+0x10/0x20
&gt; [ 7697.942005]  [&lt;ffffffff8020dc42&gt;] ? dump_stack+0x72/0x80
&gt; [ 7697.942005]  [&lt;ffffffff8036392d&gt;] ? __ratelimit+0xbd/0xe0
&gt; [ 7697.942005]  [&lt;ffffffff8036b398&gt;] ? debug_smp_processor_id+0xe8/0xf0
&gt; [ 7697.942005]  [&lt;ffffffff80239d3b&gt;] ? wake_up_klogd+0x1b/0x50
&gt; [ 7697.942005]  [&lt;ffffffff8023a047&gt;] ? release_console_sem+0x1e7/0x200
&gt; [ 7697.942005]  [&lt;ffffffff803c2de9&gt;] con_write+0x19/0x30
&gt; [ 7697.942005]  [&lt;ffffffff803b37b6&gt;] write_chan+0x276/0x3c0
&gt; [ 7697.942005]  [&lt;ffffffff80232b20&gt;] ? default_wake_function+0x0/0x10
&gt; [ 7697.942005]  [&lt;ffffffff804cb872&gt;] ? _spin_lock_irqsave+0x22/0x50
&gt; [ 7697.942005]  [&lt;ffffffff803b1334&gt;] tty_write+0x194/0x260
&gt; [ 7697.942005]  [&lt;ffffffff803b3540&gt;] ? write_chan+0x0/0x3c0
&gt; [ 7697.942005]  [&lt;ffffffff803b14a4&gt;] redirected_tty_write+0xa4/0xb0
&gt; [ 7697.942005]  [&lt;ffffffff803b1400&gt;] ? redirected_tty_write+0x0/0xb0
&gt; [ 7697.942005]  [&lt;ffffffff802a88c2&gt;] do_loop_readv_writev+0x52/0x80
&gt; [ 7697.942005]  [&lt;ffffffff802a939d&gt;] do_readv_writev+0x1bd/0x1d0
&gt; [ 7697.942005]  [&lt;ffffffff802a93e9&gt;] vfs_writev+0x39/0x60
&gt; [ 7697.942005]  [&lt;ffffffff802a9870&gt;] sys_writev+0x50/0x90
&gt; [ 7697.942005]  [&lt;ffffffff8020bb3b&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Reported-by: Dmitry Adamushko &lt;dmitry.adamushko@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>futex: Handle user space corruption gracefully</title>
<updated>2010-04-01T22:52:16+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2010-02-02T10:40:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=873b48a4cf4a64dd77faef25ddcf1651cef49a32'/>
<id>873b48a4cf4a64dd77faef25ddcf1651cef49a32</id>
<content type='text'>
commit 51246bfd189064079c54421507236fd2723b18f3 upstream.

If the owner of a PI futex dies we fix up the pi_state and set
pi_state-&gt;owner to NULL. When a malicious or just sloppy programmed
user space application sets the futex value to 0 e.g. by calling
pthread_mutex_init(), then the futex can be acquired again. A new
waiter manages to enqueue itself on the pi_state w/o damage, but on
unlock the kernel dereferences pi_state-&gt;owner and oopses.

Prevent this by checking pi_state-&gt;owner in the unlock path. If
pi_state-&gt;owner is not current we know that user space manipulated the
futex value. Ignore the mess and return -EINVAL.

This catches the above case and also the case where a task hijacks the
futex by setting the tid value and then tries to unlock it.

Reported-by: Jermome Marchand &lt;jmarchan@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Darren Hart &lt;dvhltc@us.ibm.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 51246bfd189064079c54421507236fd2723b18f3 upstream.

If the owner of a PI futex dies we fix up the pi_state and set
pi_state-&gt;owner to NULL. When a malicious or just sloppy programmed
user space application sets the futex value to 0 e.g. by calling
pthread_mutex_init(), then the futex can be acquired again. A new
waiter manages to enqueue itself on the pi_state w/o damage, but on
unlock the kernel dereferences pi_state-&gt;owner and oopses.

Prevent this by checking pi_state-&gt;owner in the unlock path. If
pi_state-&gt;owner is not current we know that user space manipulated the
futex value. Ignore the mess and return -EINVAL.

This catches the above case and also the case where a task hijacks the
futex by setting the tid value and then tries to unlock it.

Reported-by: Jermome Marchand &lt;jmarchan@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Darren Hart &lt;dvhltc@us.ibm.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>futex: Handle futex value corruption gracefully</title>
<updated>2010-04-01T22:52:16+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2010-02-03T08:33:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=268ec2564310a552681bcbfb412c35804c06efad'/>
<id>268ec2564310a552681bcbfb412c35804c06efad</id>
<content type='text'>
commit 59647b6ac3050dd964bc556fe6ef22f4db5b935c upstream.

The WARN_ON in lookup_pi_state which complains about a mismatch
between pi_state-&gt;owner-&gt;pid and the pid which we retrieved from the
user space futex is completely bogus.

The code just emits the warning and then continues despite the fact
that it detected an inconsistent state of the futex. A conveniant way
for user space to spam the syslog.

Replace the WARN_ON by a consistency check. If the values do not match
return -EINVAL and let user space deal with the mess it created.

This also fixes the missing task_pid_vnr() when we compare the
pi_state-&gt;owner pid with the futex value.

Reported-by: Jermome Marchand &lt;jmarchan@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Darren Hart &lt;dvhltc@us.ibm.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 59647b6ac3050dd964bc556fe6ef22f4db5b935c upstream.

The WARN_ON in lookup_pi_state which complains about a mismatch
between pi_state-&gt;owner-&gt;pid and the pid which we retrieved from the
user space futex is completely bogus.

The code just emits the warning and then continues despite the fact
that it detected an inconsistent state of the futex. A conveniant way
for user space to spam the syslog.

Replace the WARN_ON by a consistency check. If the values do not match
return -EINVAL and let user space deal with the mess it created.

This also fixes the missing task_pid_vnr() when we compare the
pi_state-&gt;owner pid with the futex value.

Reported-by: Jermome Marchand &lt;jmarchan@redhat.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Darren Hart &lt;dvhltc@us.ibm.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fix more leaks in audit_tree.c tag_chunk()</title>
<updated>2010-01-18T18:33:58+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2009-12-19T16:03:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6f5195525e548d474a77ce00baa927e5c7ed6976'/>
<id>6f5195525e548d474a77ce00baa927e5c7ed6976</id>
<content type='text'>
commit b4c30aad39805902cf5b855aa8a8b22d728ad057 upstream.

Several leaks in audit_tree didn't get caught by commit
318b6d3d7ddbcad3d6867e630711b8a705d873d7, including the leak on normal
exit in case of multiple rules refering to the same chunk.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b4c30aad39805902cf5b855aa8a8b22d728ad057 upstream.

Several leaks in audit_tree didn't get caught by commit
318b6d3d7ddbcad3d6867e630711b8a705d873d7, including the leak on normal
exit in case of multiple rules refering to the same chunk.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fix braindamage in audit_tree.c untag_chunk()</title>
<updated>2010-01-18T18:33:53+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2009-12-19T15:59:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0ad8dbec4622c3eef0abe019b9f036ff6a12f277'/>
<id>0ad8dbec4622c3eef0abe019b9f036ff6a12f277</id>
<content type='text'>
commit 6f5d51148921c242680a7a1d9913384a30ab3cbe upstream.

... aka "Al had badly fscked up when writing that thing and nobody
noticed until Eric had fixed leaks that used to mask the breakage".

The function essentially creates a copy of old array sans one element
and replaces the references to elements of original (they are on cyclic
lists) with those to corresponding elements of new one.  After that the
old one is fair game for freeing.

First of all, there's a dumb braino: when we get to list_replace_init we
use indices for wrong arrays - position in new one with the old array
and vice versa.

Another bug is more subtle - termination condition is wrong if the
element to be excluded happens to be the last one.  We shouldn't go
until we fill the new array, we should go until we'd finished the old
one.  Otherwise the element we are trying to kill will remain on the
cyclic lists...

That crap used to be masked by several leaks, so it was not quite
trivial to hit.  Eric had fixed some of those leaks a while ago and the
shit had hit the fan...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 6f5d51148921c242680a7a1d9913384a30ab3cbe upstream.

... aka "Al had badly fscked up when writing that thing and nobody
noticed until Eric had fixed leaks that used to mask the breakage".

The function essentially creates a copy of old array sans one element
and replaces the references to elements of original (they are on cyclic
lists) with those to corresponding elements of new one.  After that the
old one is fair game for freeing.

First of all, there's a dumb braino: when we get to list_replace_init we
use indices for wrong arrays - position in new one with the old array
and vice versa.

Another bug is more subtle - termination condition is wrong if the
element to be excluded happens to be the last one.  We shouldn't go
until we fill the new array, we should go until we'd finished the old
one.  Otherwise the element we are trying to kill will remain on the
cyclic lists...

That crap used to be masked by several leaks, so it was not quite
trivial to hit.  Eric had fixed some of those leaks a while ago and the
shit had hit the fan...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>kernel/signal.c: fix kernel information leak with print-fatal-signals=1</title>
<updated>2010-01-18T18:33:41+00:00</updated>
<author>
<name>Andi Kleen</name>
<email>andi@firstfloor.org</email>
</author>
<published>2010-01-08T22:42:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e3f94f64a91768da5b136b22dc5faa2447ec2ac8'/>
<id>e3f94f64a91768da5b136b22dc5faa2447ec2ac8</id>
<content type='text'>
commit b45c6e76bc2c72f6426c14bed64fdcbc9bf37cb0 upstream.

When print-fatal-signals is enabled it's possible to dump any memory
reachable by the kernel to the log by simply jumping to that address from
user space.

Or crash the system if there's some hardware with read side effects.

The fatal signals handler will dump 16 bytes at the execution address,
which is fully controlled by ring 3.

In addition when something jumps to a unmapped address there will be up to
16 additional useless page faults, which might be potentially slow (and at
least is not very efficient)

Fortunately this option is off by default and only there on i386.

But fix it by checking for kernel addresses and also stopping when there's
a page fault.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Oleg Nesterov &lt;oleg@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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b45c6e76bc2c72f6426c14bed64fdcbc9bf37cb0 upstream.

When print-fatal-signals is enabled it's possible to dump any memory
reachable by the kernel to the log by simply jumping to that address from
user space.

Or crash the system if there's some hardware with read side effects.

The fatal signals handler will dump 16 bytes at the execution address,
which is fully controlled by ring 3.

In addition when something jumps to a unmapped address there will be up to
16 additional useless page faults, which might be potentially slow (and at
least is not very efficient)

Fortunately this option is off by default and only there on i386.

But fix it by checking for kernel addresses and also stopping when there's
a page fault.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Oleg Nesterov &lt;oleg@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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>printk: robustify printk</title>
<updated>2009-11-10T00:52:43+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-08-08T19:47:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=71e2f32b6006fcef62578fb5bb7ba025a85a2d44'/>
<id>71e2f32b6006fcef62578fb5bb7ba025a85a2d44</id>
<content type='text'>
commit b845b517b5e3706a3729f6ea83b88ab85f0725b0 upstream.

Avoid deadlocks against rq-&gt;lock and xtime_lock by deferring the klogd
wakeup by polling from the timer tick.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b845b517b5e3706a3729f6ea83b88ab85f0725b0 upstream.

Avoid deadlocks against rq-&gt;lock and xtime_lock by deferring the klogd
wakeup by polling from the timer tick.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
</feed>
