<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel, branch v2.6.27.56</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>sched: Fix string comparison in /proc/sched_features</title>
<updated>2010-11-22T18:43:09+00:00</updated>
<author>
<name>Mathieu Desnoyers</name>
<email>mathieu.desnoyers@efficios.com</email>
</author>
<published>2010-09-13T21:47:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bfa24c0d95759f192848c95e26a422216bb2ee1b'/>
<id>bfa24c0d95759f192848c95e26a422216bb2ee1b</id>
<content type='text'>
commit 7740191cd909b75d75685fb08a5d1f54b8a9d28b upstream.

Fix incorrect handling of the following case:

 INTERACTIVE
 INTERACTIVE_SOMETHING_ELSE

The comparison only checks up to each element's length.

Changelog since v1:
 - Embellish using some Rostedtisms.
  [ mingo:                 ^^ == smaller and cleaner ]

Signed-off-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Reviewed-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Tony Lindgren &lt;tony@atomide.com&gt;
LKML-Reference: &lt;20100913214700.GB16118@Krystal&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 7740191cd909b75d75685fb08a5d1f54b8a9d28b upstream.

Fix incorrect handling of the following case:

 INTERACTIVE
 INTERACTIVE_SOMETHING_ELSE

The comparison only checks up to each element's length.

Changelog since v1:
 - Embellish using some Rostedtisms.
  [ mingo:                 ^^ == smaller and cleaner ]

Signed-off-by: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Reviewed-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Tony Lindgren &lt;tony@atomide.com&gt;
LKML-Reference: &lt;20100913214700.GB16118@Krystal&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>compat: Make compat_alloc_user_space() incorporate the access_ok()</title>
<updated>2010-09-20T20:03:21+00:00</updated>
<author>
<name>H. Peter Anvin</name>
<email>hpa@linux.intel.com</email>
</author>
<published>2010-09-07T23:16:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1d3fb6bbb5c235568f80fd708e5ec6149b5d141c'/>
<id>1d3fb6bbb5c235568f80fd708e5ec6149b5d141c</id>
<content type='text'>
commit c41d68a513c71e35a14f66d71782d27a79a81ea6 upstream.

compat_alloc_user_space() expects the caller to independently call
access_ok() to verify the returned area.  A missing call could
introduce problems on some architectures.

This patch incorporates the access_ok() check into
compat_alloc_user_space() and also adds a sanity check on the length.
The existing compat_alloc_user_space() implementations are renamed
arch_compat_alloc_user_space() and are used as part of the
implementation of the new global function.

This patch assumes NULL will cause __get_user()/__put_user() to either
fail or access userspace on all architectures.  This should be
followed by checking the return value of compat_access_user_space()
for NULL in the callers, at which time the access_ok() in the callers
can also be removed.

Reported-by: Ben Hawkes &lt;hawkes@sota.gen.nz&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
Acked-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Acked-by: Chris Metcalf &lt;cmetcalf@tilera.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Helge Deller &lt;deller@gmx.de&gt;
Cc: James Bottomley &lt;jejb@parisc-linux.org&gt;
Cc: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.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 c41d68a513c71e35a14f66d71782d27a79a81ea6 upstream.

compat_alloc_user_space() expects the caller to independently call
access_ok() to verify the returned area.  A missing call could
introduce problems on some architectures.

This patch incorporates the access_ok() check into
compat_alloc_user_space() and also adds a sanity check on the length.
The existing compat_alloc_user_space() implementations are renamed
arch_compat_alloc_user_space() and are used as part of the
implementation of the new global function.

This patch assumes NULL will cause __get_user()/__put_user() to either
fail or access userspace on all architectures.  This should be
followed by checking the return value of compat_access_user_space()
for NULL in the callers, at which time the access_ok() in the callers
can also be removed.

Reported-by: Ben Hawkes &lt;hawkes@sota.gen.nz&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
Acked-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Acked-by: Chris Metcalf &lt;cmetcalf@tilera.com&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Fenghua Yu &lt;fenghua.yu@intel.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Helge Deller &lt;deller@gmx.de&gt;
Cc: James Bottomley &lt;jejb@parisc-linux.org&gt;
Cc: Kyle McMartin &lt;kyle@mcmartin.ca&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>tracing: Do not allow llseek to set_ftrace_filter</title>
<updated>2010-09-20T20:03:20+00:00</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2010-09-08T15:20:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9af1d24a2b18b890a9f73aa6e3efdc70a16c54aa'/>
<id>9af1d24a2b18b890a9f73aa6e3efdc70a16c54aa</id>
<content type='text'>
commit 9c55cb12c1c172e2d51e85fbb5a4796ca86b77e7 upstream.

Reading the file set_ftrace_filter does three things.

1) shows whether or not filters are set for the function tracer
2) shows what functions are set for the function tracer
3) shows what triggers are set on any functions

3 is independent from 1 and 2.

The way this file currently works is that it is a state machine,
and as you read it, it may change state. But this assumption breaks
when you use lseek() on the file. The state machine gets out of sync
and the t_show() may use the wrong pointer and cause a kernel oops.

Luckily, this will only kill the app that does the lseek, but the app
dies while holding a mutex. This prevents anyone else from using the
set_ftrace_filter file (or any other function tracing file for that matter).

A real fix for this is to rewrite the code, but that is too much for
a -rc release or stable. This patch simply disables llseek on the
set_ftrace_filter() file for now, and we can do the proper fix for the
next major release.

Reported-by: Robert Swiecki &lt;swiecki@google.com&gt;
Cc: Chris Wright &lt;chrisw@sous-sol.org&gt;
Cc: Tavis Ormandy &lt;taviso@google.com&gt;
Cc: Eugene Teo &lt;eugene@redhat.com&gt;
Cc: vendor-sec@lst.de
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.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 9c55cb12c1c172e2d51e85fbb5a4796ca86b77e7 upstream.

Reading the file set_ftrace_filter does three things.

1) shows whether or not filters are set for the function tracer
2) shows what functions are set for the function tracer
3) shows what triggers are set on any functions

3 is independent from 1 and 2.

The way this file currently works is that it is a state machine,
and as you read it, it may change state. But this assumption breaks
when you use lseek() on the file. The state machine gets out of sync
and the t_show() may use the wrong pointer and cause a kernel oops.

Luckily, this will only kill the app that does the lseek, but the app
dies while holding a mutex. This prevents anyone else from using the
set_ftrace_filter file (or any other function tracing file for that matter).

A real fix for this is to rewrite the code, but that is too much for
a -rc release or stable. This patch simply disables llseek on the
set_ftrace_filter() file for now, and we can do the proper fix for the
next major release.

Reported-by: Robert Swiecki &lt;swiecki@google.com&gt;
Cc: Chris Wright &lt;chrisw@sous-sol.org&gt;
Cc: Tavis Ormandy &lt;taviso@google.com&gt;
Cc: Eugene Teo &lt;eugene@redhat.com&gt;
Cc: vendor-sec@lst.de
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<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>
</feed>
