<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel, branch v2.6.27.46</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel?h=v2.6.27.46</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel?h=v2.6.27.46'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2010-04-01T22:52:21Z</updated>
<entry>
<title>sched: wakeup preempt when small overlap</title>
<updated>2010-04-01T22:52:21Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-09-20T21:38:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ecfb7fb9b13c617447a7f6b5925da26798c1a8a1'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>printk: robustify printk, fix #2</title>
<updated>2010-04-01T22:52:17Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-08-20T07:31:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4594467f733524ec6ef31648b8f5b7fce1856852'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>futex: Handle user space corruption gracefully</title>
<updated>2010-04-01T22:52:16Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2010-02-02T10:40:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=873b48a4cf4a64dd77faef25ddcf1651cef49a32'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>futex: Handle futex value corruption gracefully</title>
<updated>2010-04-01T22:52:16Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2010-02-03T08:33:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=268ec2564310a552681bcbfb412c35804c06efad'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>fix more leaks in audit_tree.c tag_chunk()</title>
<updated>2010-01-18T18:33:58Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2009-12-19T16:03:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6f5195525e548d474a77ce00baa927e5c7ed6976'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>fix braindamage in audit_tree.c untag_chunk()</title>
<updated>2010-01-18T18:33:53Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2009-12-19T15:59:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0ad8dbec4622c3eef0abe019b9f036ff6a12f277'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>kernel/signal.c: fix kernel information leak with print-fatal-signals=1</title>
<updated>2010-01-18T18:33:41Z</updated>
<author>
<name>Andi Kleen</name>
<email>andi@firstfloor.org</email>
</author>
<published>2010-01-08T22:42:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e3f94f64a91768da5b136b22dc5faa2447ec2ac8'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>printk: robustify printk</title>
<updated>2009-11-10T00:52:43Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2008-08-08T19:47:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=71e2f32b6006fcef62578fb5bb7ba025a85a2d44'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>time: catch xtime_nsec underflows and fix them</title>
<updated>2009-10-12T18:33:23Z</updated>
<author>
<name>john stultz</name>
<email>johnstul@us.ibm.com</email>
</author>
<published>2008-12-02T02:34:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3ce4d0a0f7184d5fe17747841f628adac60ed262'/>
<id>urn:sha1:3ce4d0a0f7184d5fe17747841f628adac60ed262</id>
<content type='text'>
commit 6c9bacb41c10ba84ff68f238e234d96f35fb64f7 upstream.

Impact: fix time warp bug

Alex Shi, along with Yanmin Zhang have been noticing occasional time
inconsistencies recently. Through their great diagnosis, they found that
the xtime_nsec value used in update_wall_time was occasionally going
negative. After looking through the code for awhile, I realized we have
the possibility for an underflow when three conditions are met in
update_wall_time():

  1) We have accumulated a second's worth of nanoseconds, so we
     incremented xtime.tv_sec and appropriately decrement xtime_nsec.
     (This doesn't cause xtime_nsec to go negative, but it can cause it
      to be small).

  2) The remaining offset value is large, but just slightly less then
     cycle_interval.

  3) clocksource_adjust() is speeding up the clock, causing a
     corrective amount (compensating for the increase in the multiplier
     being multiplied against the unaccumulated offset value) to be
     subtracted from xtime_nsec.

This can cause xtime_nsec to underflow.

Unfortunately, since we notify the NTP subsystem via second_overflow()
whenever we accumulate a full second, and this effects the error
accumulation that has already occured, we cannot simply revert the
accumulated second from xtime nor move the second accumulation to after
the clocksource_adjust call without a change in behavior.

This leaves us with (at least) two options:

1) Simply return from clocksource_adjust() without making a change if we
   notice the adjustment would cause xtime_nsec to go negative.

This would work, but I'm concerned that if a large adjustment was needed
(due to the error being large), it may be possible to get stuck with an
ever increasing error that becomes too large to correct (since it may
always force xtime_nsec negative). This may just be paranoia on my part.

2) Catch xtime_nsec if it is negative, then add back the amount its
   negative to both xtime_nsec and the error.

This second method is consistent with how we've handled earlier rounding
issues, and also has the benefit that the error being added is always in
the oposite direction also always equal or smaller then the correction
being applied. So the risk of a corner case where things get out of
control is lessened.

This patch fixes bug 11970, as tested by Yanmin Zhang
http://bugzilla.kernel.org/show_bug.cgi?id=11970

Reported-by: alex.shi@intel.com
Signed-off-by: John Stultz &lt;johnstul@us.ibm.com&gt;
Acked-by: Yanmin Zhang &lt;yanmin_zhang@linux.intel.com&gt;
Tested-by: Yanmin Zhang &lt;yanmin_zhang@linux.intel.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>kthreads: fix kthread_create() vs kthread_stop() race</title>
<updated>2009-09-09T03:17:39Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2009-08-24T10:45:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3b9246e2b55f8aa3c3d9732d0eb7e9943a6f9492'/>
<id>urn:sha1:3b9246e2b55f8aa3c3d9732d0eb7e9943a6f9492</id>
<content type='text'>
The bug should be "accidently" fixed by recent changes in 2.6.31,
all kernels &lt;= 2.6.30 need the fix. The problem was never noticed before,
it was found because it causes mysterious failures with GFS mount/umount.

Credits to Robert Peterson. He blaimed kthread.c from the very beginning.
But, despite my promise, I forgot to inspect the old implementation until
he did a lot of testing and reminded me. This led to huge delay in fixing
this bug.

kthread_stop() does put_task_struct(k) before it clears kthread_stop_info.k.
This means another kthread_create() can re-use this task_struct, but the
new kthread can still see kthread_should_stop() == T and exit even without
calling threadfn().

Reported-by: Robert Peterson &lt;rpeterso@redhat.com&gt;
Tested-by: Robert Peterson &lt;rpeterso@redhat.com&gt;
Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Acked-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

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