<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel, branch v2.6.23.9</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>softlockup: use cpu_clock() instead of sched_clock()</title>
<updated>2007-11-26T17:42:32+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2007-10-17T06:26:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=fd5ec14e724268168221b7210fb36a223bd09c11'/>
<id>fd5ec14e724268168221b7210fb36a223bd09c11</id>
<content type='text'>
patch a3b13c23f186ecb57204580cc1f2dbe9c284953a in mainline.

sched_clock() is not a reliable time-source, use cpu_clock() instead.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&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>
patch a3b13c23f186ecb57204580cc1f2dbe9c284953a in mainline.

sched_clock() is not a reliable time-source, use cpu_clock() instead.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&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>softlockup watchdog fixes and cleanups</title>
<updated>2007-11-26T17:42:32+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2007-11-18T00:55:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=00aceb500c508412f70b71c78471fcf80a9498c2'/>
<id>00aceb500c508412f70b71c78471fcf80a9498c2</id>
<content type='text'>
This is a merge of commits a5f2ce3c6024a5bb895647b6bd88ecae5001020a and
43581a10075492445f65234384210492ff333eba in mainline to fix a warning in
the 2.6.23.3 kernel release.

softlockup watchdog: style cleanups

kernel/softirq.c grew a few style uncleanlinesses in the past few
months, clean that up. No functional changes:

text    data     bss     dec     hex filename
1126      76       4    1206     4b6 softlockup.o.before
1129      76       4    1209     4b9 softlockup.o.after

( the 3 bytes .text increase is due to the "&lt;1&gt;" appended to one of
the printk messages. )

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;


softlockup: improve debug output

Improve the debuggability of kernel lockups by enhancing the debug
output of the softlockup detector: print the task that causes the lockup
and try to print a more intelligent backtrace.

The old format was:

BUG: soft lockup detected on CPU#1!
[&lt;c0105e4a&gt;] show_trace_log_lvl+0x19/0x2e
[&lt;c0105f43&gt;] show_trace+0x12/0x14
[&lt;c0105f59&gt;] dump_stack+0x14/0x16
[&lt;c015f6bc&gt;] softlockup_tick+0xbe/0xd0
[&lt;c013457d&gt;] run_local_timers+0x12/0x14
[&lt;c01346b8&gt;] update_process_times+0x3e/0x63
[&lt;c0145fb8&gt;] tick_sched_timer+0x7c/0xc0
[&lt;c0140a75&gt;] hrtimer_interrupt+0x135/0x1ba
[&lt;c011bde7&gt;] smp_apic_timer_interrupt+0x6e/0x80
[&lt;c0105aa3&gt;] apic_timer_interrupt+0x33/0x38
[&lt;c0104f8a&gt;] syscall_call+0x7/0xb
=======================

The new format is:

BUG: soft lockup detected on CPU#1! [prctl:2363]

Pid: 2363, comm:                prctl
EIP: 0060:[&lt;c013915f&gt;] CPU: 1
EIP is at sys_prctl+0x24/0x18c
EFLAGS: 00000213    Not tainted  (2.6.22-cfs-v20 #26)
EAX: 00000001 EBX: 000003e7 ECX: 00000001 EDX: f6df0000
ESI: 000003e7 EDI: 000003e7 EBP: f6df0fb0 DS: 007b ES: 007b FS: 00d8
CR0: 8005003b CR2: 4d8c3340 CR3: 3731d000 CR4: 000006d0
[&lt;c0105e4a&gt;] show_trace_log_lvl+0x19/0x2e
[&lt;c0105f43&gt;] show_trace+0x12/0x14
[&lt;c01040be&gt;] show_regs+0x1ab/0x1b3
[&lt;c015f807&gt;] softlockup_tick+0xef/0x108
[&lt;c013457d&gt;] run_local_timers+0x12/0x14
[&lt;c01346b8&gt;] update_process_times+0x3e/0x63
[&lt;c0145fcc&gt;] tick_sched_timer+0x7c/0xc0
[&lt;c0140a89&gt;] hrtimer_interrupt+0x135/0x1ba
[&lt;c011bde7&gt;] smp_apic_timer_interrupt+0x6e/0x80
[&lt;c0105aa3&gt;] apic_timer_interrupt+0x33/0x38
[&lt;c0104f8a&gt;] syscall_call+0x7/0xb
=======================

Note that in the old format we only knew that some system call locked
up, we didnt know _which_. With the new format we know that it's at a
specific place in sys_prctl(). [which was where i created an artificial
kernel lockup to test the new format.]

This is also useful if the lockup happens in user-space - the user-space
EIP (and other registers) will be printed too. (such a lockup would
either suggest that the task was running at SCHED_FIFO:99 and looping
for more than 10 seconds, or that the softlockup detector has a
false-positive.)

The task name is printed too first, just in case we dont manage to print
a useful backtrace.

[satyam@infradead.org: fix warning]
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Satyam Sharma &lt;satyam@infradead.org&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>
This is a merge of commits a5f2ce3c6024a5bb895647b6bd88ecae5001020a and
43581a10075492445f65234384210492ff333eba in mainline to fix a warning in
the 2.6.23.3 kernel release.

softlockup watchdog: style cleanups

kernel/softirq.c grew a few style uncleanlinesses in the past few
months, clean that up. No functional changes:

text    data     bss     dec     hex filename
1126      76       4    1206     4b6 softlockup.o.before
1129      76       4    1209     4b9 softlockup.o.after

( the 3 bytes .text increase is due to the "&lt;1&gt;" appended to one of
the printk messages. )

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;


softlockup: improve debug output

Improve the debuggability of kernel lockups by enhancing the debug
output of the softlockup detector: print the task that causes the lockup
and try to print a more intelligent backtrace.

The old format was:

BUG: soft lockup detected on CPU#1!
[&lt;c0105e4a&gt;] show_trace_log_lvl+0x19/0x2e
[&lt;c0105f43&gt;] show_trace+0x12/0x14
[&lt;c0105f59&gt;] dump_stack+0x14/0x16
[&lt;c015f6bc&gt;] softlockup_tick+0xbe/0xd0
[&lt;c013457d&gt;] run_local_timers+0x12/0x14
[&lt;c01346b8&gt;] update_process_times+0x3e/0x63
[&lt;c0145fb8&gt;] tick_sched_timer+0x7c/0xc0
[&lt;c0140a75&gt;] hrtimer_interrupt+0x135/0x1ba
[&lt;c011bde7&gt;] smp_apic_timer_interrupt+0x6e/0x80
[&lt;c0105aa3&gt;] apic_timer_interrupt+0x33/0x38
[&lt;c0104f8a&gt;] syscall_call+0x7/0xb
=======================

The new format is:

BUG: soft lockup detected on CPU#1! [prctl:2363]

Pid: 2363, comm:                prctl
EIP: 0060:[&lt;c013915f&gt;] CPU: 1
EIP is at sys_prctl+0x24/0x18c
EFLAGS: 00000213    Not tainted  (2.6.22-cfs-v20 #26)
EAX: 00000001 EBX: 000003e7 ECX: 00000001 EDX: f6df0000
ESI: 000003e7 EDI: 000003e7 EBP: f6df0fb0 DS: 007b ES: 007b FS: 00d8
CR0: 8005003b CR2: 4d8c3340 CR3: 3731d000 CR4: 000006d0
[&lt;c0105e4a&gt;] show_trace_log_lvl+0x19/0x2e
[&lt;c0105f43&gt;] show_trace+0x12/0x14
[&lt;c01040be&gt;] show_regs+0x1ab/0x1b3
[&lt;c015f807&gt;] softlockup_tick+0xef/0x108
[&lt;c013457d&gt;] run_local_timers+0x12/0x14
[&lt;c01346b8&gt;] update_process_times+0x3e/0x63
[&lt;c0145fcc&gt;] tick_sched_timer+0x7c/0xc0
[&lt;c0140a89&gt;] hrtimer_interrupt+0x135/0x1ba
[&lt;c011bde7&gt;] smp_apic_timer_interrupt+0x6e/0x80
[&lt;c0105aa3&gt;] apic_timer_interrupt+0x33/0x38
[&lt;c0104f8a&gt;] syscall_call+0x7/0xb
=======================

Note that in the old format we only knew that some system call locked
up, we didnt know _which_. With the new format we know that it's at a
specific place in sys_prctl(). [which was where i created an artificial
kernel lockup to test the new format.]

This is also useful if the lockup happens in user-space - the user-space
EIP (and other registers) will be printed too. (such a lockup would
either suggest that the task was running at SCHED_FIFO:99 and looping
for more than 10 seconds, or that the softlockup detector has a
false-positive.)

The task name is printed too first, just in case we dont manage to print
a useful backtrace.

[satyam@infradead.org: fix warning]
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Satyam Sharma &lt;satyam@infradead.org&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>ntp: fix typo that makes sync_cmos_clock erratic</title>
<updated>2007-11-26T17:42:32+00:00</updated>
<author>
<name>David P. Reed</name>
<email>dpreed@reed.com</email>
</author>
<published>2007-11-14T22:49:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2d429c89279f78109db05d9b7db3348fc64b4ca5'/>
<id>2d429c89279f78109db05d9b7db3348fc64b4ca5</id>
<content type='text'>
patch fa6a1a554b50cbb7763f6907e6fef927ead480d9 in mainline.

ntp: fix typo that makes sync_cmos_clock erratic

Fix a typo in ntp.c that has caused updating of the persistent (RTC)
clock when synced to NTP to behave erratically.

When debugging a freeze that arises on my AMD64 machines when I
run the ntpd service, I added a number of printk's to monitor the
sync_cmos_clock procedure.  I discovered that it was not syncing to
cmos RTC every 11 minutes as documented, but instead would keep trying
every second for hours at a time.  The reason turned out to be a typo
in sync_cmos_clock, where it attempts to ensure that
update_persistent_clock is called very close to 500 msec. after a 1
second boundary (required by the PC RTC's spec). That typo referred to
"xtime" in one spot, rather than "now", which is derived from "xtime"
but not equal to it.  This makes the test erratic, creating a
"coin-flip" that decides when update_persistent_clock is called - when
it is called, which is rarely, it may be at any time during the one
second period, rather than close to 500 msec, so the value written is
needlessly incorrect, too.

Signed-off-by: David P. Reed &lt;dpreed@reed.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&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>
patch fa6a1a554b50cbb7763f6907e6fef927ead480d9 in mainline.

ntp: fix typo that makes sync_cmos_clock erratic

Fix a typo in ntp.c that has caused updating of the persistent (RTC)
clock when synced to NTP to behave erratically.

When debugging a freeze that arises on my AMD64 machines when I
run the ntpd service, I added a number of printk's to monitor the
sync_cmos_clock procedure.  I discovered that it was not syncing to
cmos RTC every 11 minutes as documented, but instead would keep trying
every second for hours at a time.  The reason turned out to be a typo
in sync_cmos_clock, where it attempts to ensure that
update_persistent_clock is called very close to 500 msec. after a 1
second boundary (required by the PC RTC's spec). That typo referred to
"xtime" in one spot, rather than "now", which is derived from "xtime"
but not equal to it.  This makes the test erratic, creating a
"coin-flip" that decides when update_persistent_clock is called - when
it is called, which is rarely, it may be at any time during the one
second period, rather than close to 500 msec, so the value written is
needlessly incorrect, too.

Signed-off-by: David P. Reed &lt;dpreed@reed.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&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>Fix divide-by-zero in the 2.6.23 scheduler code</title>
<updated>2007-11-26T17:42:30+00:00</updated>
<author>
<name>Chuck Ebbert</name>
<email>cebbert@redhat.com</email>
</author>
<published>2007-11-14T23:33:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=23a5e6a55c8653d79783a0ebda8083999fb97054'/>
<id>23a5e6a55c8653d79783a0ebda8083999fb97054</id>
<content type='text'>
No patch in mainline as this logic has been removed from 2.6.24 so it is
not necessary.


https://bugzilla.redhat.com/show_bug.cgi?id=340161

The problem code has been removed in 2.6.24. The below patch disables
SCHED_FEAT_PRECISE_CPU_LOAD which causes the offending code to be skipped
but does not prevent the user from enabling it.

The divide-by-zero is here in kernel/sched.c:

static void update_cpu_load(struct rq *this_rq)
{
	u64 fair_delta64, exec_delta64, idle_delta64, sample_interval64, tmp64;
	unsigned long total_load = this_rq-&gt;ls.load.weight;
	unsigned long this_load =  total_load;
	struct load_stat *ls = &amp;this_rq-&gt;ls;
	int i, scale;

	this_rq-&gt;nr_load_updates++;
	if (unlikely(!(sysctl_sched_features &amp; SCHED_FEAT_PRECISE_CPU_LOAD)))
		goto do_avg;

	/* Update delta_fair/delta_exec fields first */
	update_curr_load(this_rq);

	fair_delta64 = ls-&gt;delta_fair + 1;
	ls-&gt;delta_fair = 0;

	exec_delta64 = ls-&gt;delta_exec + 1;
	ls-&gt;delta_exec = 0;

	sample_interval64 = this_rq-&gt;clock - ls-&gt;load_update_last;
	ls-&gt;load_update_last = this_rq-&gt;clock;

	if ((s64)sample_interval64 &lt; (s64)TICK_NSEC)
		sample_interval64 = TICK_NSEC;

	if (exec_delta64 &gt; sample_interval64)
		exec_delta64 = sample_interval64;

	idle_delta64 = sample_interval64 - exec_delta64;

======&gt;	tmp64 = div64_64(SCHED_LOAD_SCALE * exec_delta64, fair_delta64);
	tmp64 = div64_64(tmp64 * exec_delta64, sample_interval64);

	this_load = (unsigned long)tmp64;

do_avg:

	/* Update our load: */
	for (i = 0, scale = 1; i &lt; CPU_LOAD_IDX_MAX; i++, scale += scale) {
		unsigned long old_load, new_load;

		/* scale is effectively 1 &lt;&lt; i now, and &gt;&gt; i divides by scale */

		old_load = this_rq-&gt;cpu_load[i];
		new_load = this_load;

		this_rq-&gt;cpu_load[i] = (old_load*(scale-1) + new_load) &gt;&gt; i;
	}
}

For stable only; the code has been removed in 2.6.24.

Signed-off-by: Chuck Ebbert &lt;cebbert@redhat.com&gt;
Acked-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>
No patch in mainline as this logic has been removed from 2.6.24 so it is
not necessary.


https://bugzilla.redhat.com/show_bug.cgi?id=340161

The problem code has been removed in 2.6.24. The below patch disables
SCHED_FEAT_PRECISE_CPU_LOAD which causes the offending code to be skipped
but does not prevent the user from enabling it.

The divide-by-zero is here in kernel/sched.c:

static void update_cpu_load(struct rq *this_rq)
{
	u64 fair_delta64, exec_delta64, idle_delta64, sample_interval64, tmp64;
	unsigned long total_load = this_rq-&gt;ls.load.weight;
	unsigned long this_load =  total_load;
	struct load_stat *ls = &amp;this_rq-&gt;ls;
	int i, scale;

	this_rq-&gt;nr_load_updates++;
	if (unlikely(!(sysctl_sched_features &amp; SCHED_FEAT_PRECISE_CPU_LOAD)))
		goto do_avg;

	/* Update delta_fair/delta_exec fields first */
	update_curr_load(this_rq);

	fair_delta64 = ls-&gt;delta_fair + 1;
	ls-&gt;delta_fair = 0;

	exec_delta64 = ls-&gt;delta_exec + 1;
	ls-&gt;delta_exec = 0;

	sample_interval64 = this_rq-&gt;clock - ls-&gt;load_update_last;
	ls-&gt;load_update_last = this_rq-&gt;clock;

	if ((s64)sample_interval64 &lt; (s64)TICK_NSEC)
		sample_interval64 = TICK_NSEC;

	if (exec_delta64 &gt; sample_interval64)
		exec_delta64 = sample_interval64;

	idle_delta64 = sample_interval64 - exec_delta64;

======&gt;	tmp64 = div64_64(SCHED_LOAD_SCALE * exec_delta64, fair_delta64);
	tmp64 = div64_64(tmp64 * exec_delta64, sample_interval64);

	this_load = (unsigned long)tmp64;

do_avg:

	/* Update our load: */
	for (i = 0, scale = 1; i &lt; CPU_LOAD_IDX_MAX; i++, scale += scale) {
		unsigned long old_load, new_load;

		/* scale is effectively 1 &lt;&lt; i now, and &gt;&gt; i divides by scale */

		old_load = this_rq-&gt;cpu_load[i];
		new_load = this_load;

		this_rq-&gt;cpu_load[i] = (old_load*(scale-1) + new_load) &gt;&gt; i;
	}
}

For stable only; the code has been removed in 2.6.24.

Signed-off-by: Chuck Ebbert &lt;cebbert@redhat.com&gt;
Acked-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>wait_task_stopped: Check p-&gt;exit_state instead of TASK_TRACED (CVE-2007-5500)</title>
<updated>2007-11-16T18:10:56+00:00</updated>
<author>
<name>Roland McGrath</name>
<email>roland@redhat.com</email>
</author>
<published>2007-11-14T06:11:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=36ef66c5d137b9a31fd8c35d236fb9e26ef74f97'/>
<id>36ef66c5d137b9a31fd8c35d236fb9e26ef74f97</id>
<content type='text'>
patch a3474224e6a01924be40a8255636ea5522c1023a in mainline

The original meaning of the old test (p-&gt;state &gt; TASK_STOPPED) was
"not dead", since it was before TASK_TRACED existed and before the
state/exit_state split.  It was a wrong correction in commit
14bf01bb0599c89fc7f426d20353b76e12555308 to make this test for
TASK_TRACED instead.  It should have been changed when TASK_TRACED
was introducted and again when exit_state was introduced.

Signed-off-by: Roland McGrath &lt;roland@redhat.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Alexey Dobriyan &lt;adobriyan@sw.ru&gt;
Cc: Kees Cook &lt;kees@ubuntu.com&gt;
Acked-by: Scott James Remnant &lt;scott@ubuntu.com&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>
patch a3474224e6a01924be40a8255636ea5522c1023a in mainline

The original meaning of the old test (p-&gt;state &gt; TASK_STOPPED) was
"not dead", since it was before TASK_TRACED existed and before the
state/exit_state split.  It was a wrong correction in commit
14bf01bb0599c89fc7f426d20353b76e12555308 to make this test for
TASK_TRACED instead.  It should have been changed when TASK_TRACED
was introducted and again when exit_state was introduced.

Signed-off-by: Roland McGrath &lt;roland@redhat.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Alexey Dobriyan &lt;adobriyan@sw.ru&gt;
Cc: Kees Cook &lt;kees@ubuntu.com&gt;
Acked-by: Scott James Remnant &lt;scott@ubuntu.com&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 compat futex hangs.</title>
<updated>2007-11-16T16:12:44+00:00</updated>
<author>
<name>David Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2007-11-13T07:59:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=59ddd4607313e7ee20b9ad36cd3b00f83068189a'/>
<id>59ddd4607313e7ee20b9ad36cd3b00f83068189a</id>
<content type='text'>
[FUTEX]: Fix address computation in compat code.

[ Upstream commit: 3c5fd9c77d609b51c0bab682c9d40cbb496ec6f1 ]

compat_exit_robust_list() computes a pointer to the
futex entry in userspace as follows:

	(void __user *)entry + futex_offset

'entry' is a 'struct robust_list __user *', and
'futex_offset' is a 'compat_long_t' (typically a 's32').

Things explode if the 32-bit sign bit is set in futex_offset.

Type promotion sign extends futex_offset to a 64-bit value before
adding it to 'entry'.

This triggered a problem on sparc64 running 32-bit applications which
would lock up a cpu looping forever in the fault handling for the
userspace load in handle_futex_death().

Compat userspace runs with address masking (wherein the cpu zeros out
the top 32-bits of every effective address given to a memory operation
instruction) so the sparc64 fault handler accounts for this by
zero'ing out the top 32-bits of the fault address too.

Since the kernel properly uses the compat_uptr interfaces, kernel side
accesses to compat userspace work too since they will only use
addresses with the top 32-bit clear.

Because of this compat futex layer bug we get into the following loop
when executing the get_user() load near the top of handle_futex_death():

1) load from address '0xfffffffff7f16bd8', FAULT
2) fault handler clears upper 32-bits, processes fault
   for address '0xf7f16bd8' which succeeds
3) goto #1

I want to thank Bernd Zeimetz, Josip Rodin, and Fabio Massimo Di Nitto
for their tireless efforts helping me track down this bug.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&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>
[FUTEX]: Fix address computation in compat code.

[ Upstream commit: 3c5fd9c77d609b51c0bab682c9d40cbb496ec6f1 ]

compat_exit_robust_list() computes a pointer to the
futex entry in userspace as follows:

	(void __user *)entry + futex_offset

'entry' is a 'struct robust_list __user *', and
'futex_offset' is a 'compat_long_t' (typically a 's32').

Things explode if the 32-bit sign bit is set in futex_offset.

Type promotion sign extends futex_offset to a 64-bit value before
adding it to 'entry'.

This triggered a problem on sparc64 running 32-bit applications which
would lock up a cpu looping forever in the fault handling for the
userspace load in handle_futex_death().

Compat userspace runs with address masking (wherein the cpu zeros out
the top 32-bits of every effective address given to a memory operation
instruction) so the sparc64 fault handler accounts for this by
zero'ing out the top 32-bits of the fault address too.

Since the kernel properly uses the compat_uptr interfaces, kernel side
accesses to compat userspace work too since they will only use
addresses with the top 32-bit clear.

Because of this compat futex layer bug we get into the following loop
when executing the get_user() load near the top of handle_futex_death():

1) load from address '0xfffffffff7f16bd8', FAULT
2) fault handler clears upper 32-bits, processes fault
   for address '0xf7f16bd8' which succeeds
3) goto #1

I want to thank Bernd Zeimetz, Josip Rodin, and Fabio Massimo Di Nitto
for their tireless efforts helping me track down this bug.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&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>sched: keep utime/stime monotonic</title>
<updated>2007-11-16T16:12:44+00:00</updated>
<author>
<name>Frans Pop</name>
<email>elendil@planet.nl</email>
</author>
<published>2007-11-14T00:18:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e823c33c6f670beba3c14f4a451fd2b34c3eb40c'/>
<id>e823c33c6f670beba3c14f4a451fd2b34c3eb40c</id>
<content type='text'>
sched: keep utime/stime monotonic

cpustats use utime/stime as a ratio against sum_exec_runtime, as a
consequence it can happen - when the ratio changes faster than time
accumulates - that either can be appear to go backwards.

Combined backport for 2.6.23 of the following patches from mainline:
commit 73a2bcb0edb9ffb0b007b3546b430e2c6e415eee
Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
  sched: keep utime/stime monotonic

commit 9301899be75b464ef097f0b5af7af6d9bd8f68a7
Author: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
  sched: fix /proc/&lt;PID&gt;/stat stime/utime monotonicity, part 2

Signed-off-by: Frans Pop &lt;elendil@planet.nl&gt;
CC: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
CC: Balbir Singh &lt;balbir@linux.vnet.ibm.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>
sched: keep utime/stime monotonic

cpustats use utime/stime as a ratio against sum_exec_runtime, as a
consequence it can happen - when the ratio changes faster than time
accumulates - that either can be appear to go backwards.

Combined backport for 2.6.23 of the following patches from mainline:
commit 73a2bcb0edb9ffb0b007b3546b430e2c6e415eee
Author: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
  sched: keep utime/stime monotonic

commit 9301899be75b464ef097f0b5af7af6d9bd8f68a7
Author: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
  sched: fix /proc/&lt;PID&gt;/stat stime/utime monotonicity, part 2

Signed-off-by: Frans Pop &lt;elendil@planet.nl&gt;
CC: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
CC: Balbir Singh &lt;balbir@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>fix the softlockup watchdog to actually work</title>
<updated>2007-11-16T16:12:43+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2007-10-17T06:18:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=436e61d93605a3a36902c9ee510b0ecba0d7d361'/>
<id>436e61d93605a3a36902c9ee510b0ecba0d7d361</id>
<content type='text'>
patch a115d5caca1a2905ba7a32b408a6042b20179aaa in mainline.

this Xen related commit:

   commit 966812dc98e6a7fcdf759cbfa0efab77500a8868
   Author: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
   Date:   Tue May 8 00:28:02 2007 -0700

       Ignore stolen time in the softlockup watchdog

broke the softlockup watchdog to never report any lockups. (!)

print_timestamp defaults to 0, this makes the following condition
always true:

	if (print_timestamp &lt; (touch_timestamp + 1) ||

and we'll in essence never report soft lockups.

apparently the functionality of the soft lockup watchdog was never
actually tested with that patch applied ...

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Jeremy Fitzhardinge &lt;jeremy@goop.org&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>
patch a115d5caca1a2905ba7a32b408a6042b20179aaa in mainline.

this Xen related commit:

   commit 966812dc98e6a7fcdf759cbfa0efab77500a8868
   Author: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
   Date:   Tue May 8 00:28:02 2007 -0700

       Ignore stolen time in the softlockup watchdog

broke the softlockup watchdog to never report any lockups. (!)

print_timestamp defaults to 0, this makes the following condition
always true:

	if (print_timestamp &lt; (touch_timestamp + 1) ||

and we'll in essence never report soft lockups.

apparently the functionality of the soft lockup watchdog was never
actually tested with that patch applied ...

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Jeremy Fitzhardinge &lt;jeremy@goop.org&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>fix param_sysfs_builtin name length check</title>
<updated>2007-11-16T16:12:43+00:00</updated>
<author>
<name>Jan Kiszka</name>
<email>jan.kiszka@web.de</email>
</author>
<published>2007-11-15T01:00:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e8af293bb2f8cc44868a67e2af8010feaa7c309b'/>
<id>e8af293bb2f8cc44868a67e2af8010feaa7c309b</id>
<content type='text'>
patch 22800a2830ec07e7cc5c837999890ac47cc7f5de in mainline.

Commit faf8c714f4508207a9c81cc94dafc76ed6680b44 caused a regression:
parameter names longer than MAX_KBUILD_MODNAME will now be rejected,
although we just need to keep the module name part that short.  This patch
restores the old behaviour while still avoiding that memchr is called with
its length parameter larger than the total string length.

Signed-off-by: Jan Kiszka &lt;jan.kiszka@web.de&gt;
Cc: Dave Young &lt;hidave.darkstar@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Chuck Ebbert &lt;cebbert@redhat.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>
patch 22800a2830ec07e7cc5c837999890ac47cc7f5de in mainline.

Commit faf8c714f4508207a9c81cc94dafc76ed6680b44 caused a regression:
parameter names longer than MAX_KBUILD_MODNAME will now be rejected,
although we just need to keep the module name part that short.  This patch
restores the old behaviour while still avoiding that memchr is called with
its length parameter larger than the total string length.

Signed-off-by: Jan Kiszka &lt;jan.kiszka@web.de&gt;
Cc: Dave Young &lt;hidave.darkstar@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Chuck Ebbert &lt;cebbert@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>param_sysfs_builtin memchr argument fix</title>
<updated>2007-11-16T16:12:42+00:00</updated>
<author>
<name>Dave Young</name>
<email>hidave.darkstar@gmail.com</email>
</author>
<published>2007-10-18T10:05:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2b5ee2866a4a4781158986f21fdaa3395bc27d13'/>
<id>2b5ee2866a4a4781158986f21fdaa3395bc27d13</id>
<content type='text'>
patch faf8c714f4508207a9c81cc94dafc76ed6680b44 in mainline.

If memchr argument is longer than strlen(kp-&gt;name), there will be some
weird result.

It will casuse duplicate filenames in sysfs for the "nousb".  kernel
warning messages are as bellow:

sysfs: duplicate filename 'usbcore' can not be created
WARNING: at fs/sysfs/dir.c:416 sysfs_add_one()
 [&lt;c01c4750&gt;] sysfs_add_one+0xa0/0xe0
 [&lt;c01c4ab8&gt;] create_dir+0x48/0xb0
 [&lt;c01c4b69&gt;] sysfs_create_dir+0x29/0x50
 [&lt;c024e0fb&gt;] create_dir+0x1b/0x50
 [&lt;c024e3b6&gt;] kobject_add+0x46/0x150
 [&lt;c024e2da&gt;] kobject_init+0x3a/0x80
 [&lt;c053b880&gt;] kernel_param_sysfs_setup+0x50/0xb0
 [&lt;c053b9ce&gt;] param_sysfs_builtin+0xee/0x130
 [&lt;c053ba33&gt;] param_sysfs_init+0x23/0x60
 [&lt;c024d062&gt;] __next_cpu+0x12/0x20
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052a856&gt;] do_initcalls+0x46/0x1e0
 [&lt;c01bdb12&gt;] create_proc_entry+0x52/0x90
 [&lt;c0158d4c&gt;] register_irq_proc+0x9c/0xc0
 [&lt;c01bda94&gt;] proc_mkdir_mode+0x34/0x50
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052aa92&gt;] kernel_init+0x62/0xb0
 [&lt;c0104f83&gt;] kernel_thread_helper+0x7/0x14
 =======================
kobject_add failed for usbcore with -EEXIST, don't try to register things with the same name in the same directory.
 [&lt;c024e466&gt;] kobject_add+0xf6/0x150
 [&lt;c053b880&gt;] kernel_param_sysfs_setup+0x50/0xb0
 [&lt;c053b9ce&gt;] param_sysfs_builtin+0xee/0x130
 [&lt;c053ba33&gt;] param_sysfs_init+0x23/0x60
 [&lt;c024d062&gt;] __next_cpu+0x12/0x20
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052a856&gt;] do_initcalls+0x46/0x1e0
 [&lt;c01bdb12&gt;] create_proc_entry+0x52/0x90
 [&lt;c0158d4c&gt;] register_irq_proc+0x9c/0xc0
 [&lt;c01bda94&gt;] proc_mkdir_mode+0x34/0x50
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052aa92&gt;] kernel_init+0x62/0xb0
 [&lt;c0104f83&gt;] kernel_thread_helper+0x7/0x14
 =======================
Module 'usbcore' failed to be added to sysfs, error number -17
The system will be unstable now.

Signed-off-by: Dave Young &lt;hidave.darkstar@gmail.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Chuck Ebbert &lt;cebbert@redhat.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>
patch faf8c714f4508207a9c81cc94dafc76ed6680b44 in mainline.

If memchr argument is longer than strlen(kp-&gt;name), there will be some
weird result.

It will casuse duplicate filenames in sysfs for the "nousb".  kernel
warning messages are as bellow:

sysfs: duplicate filename 'usbcore' can not be created
WARNING: at fs/sysfs/dir.c:416 sysfs_add_one()
 [&lt;c01c4750&gt;] sysfs_add_one+0xa0/0xe0
 [&lt;c01c4ab8&gt;] create_dir+0x48/0xb0
 [&lt;c01c4b69&gt;] sysfs_create_dir+0x29/0x50
 [&lt;c024e0fb&gt;] create_dir+0x1b/0x50
 [&lt;c024e3b6&gt;] kobject_add+0x46/0x150
 [&lt;c024e2da&gt;] kobject_init+0x3a/0x80
 [&lt;c053b880&gt;] kernel_param_sysfs_setup+0x50/0xb0
 [&lt;c053b9ce&gt;] param_sysfs_builtin+0xee/0x130
 [&lt;c053ba33&gt;] param_sysfs_init+0x23/0x60
 [&lt;c024d062&gt;] __next_cpu+0x12/0x20
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052a856&gt;] do_initcalls+0x46/0x1e0
 [&lt;c01bdb12&gt;] create_proc_entry+0x52/0x90
 [&lt;c0158d4c&gt;] register_irq_proc+0x9c/0xc0
 [&lt;c01bda94&gt;] proc_mkdir_mode+0x34/0x50
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052aa92&gt;] kernel_init+0x62/0xb0
 [&lt;c0104f83&gt;] kernel_thread_helper+0x7/0x14
 =======================
kobject_add failed for usbcore with -EEXIST, don't try to register things with the same name in the same directory.
 [&lt;c024e466&gt;] kobject_add+0xf6/0x150
 [&lt;c053b880&gt;] kernel_param_sysfs_setup+0x50/0xb0
 [&lt;c053b9ce&gt;] param_sysfs_builtin+0xee/0x130
 [&lt;c053ba33&gt;] param_sysfs_init+0x23/0x60
 [&lt;c024d062&gt;] __next_cpu+0x12/0x20
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052a856&gt;] do_initcalls+0x46/0x1e0
 [&lt;c01bdb12&gt;] create_proc_entry+0x52/0x90
 [&lt;c0158d4c&gt;] register_irq_proc+0x9c/0xc0
 [&lt;c01bda94&gt;] proc_mkdir_mode+0x34/0x50
 [&lt;c052aa30&gt;] kernel_init+0x0/0xb0
 [&lt;c052aa92&gt;] kernel_init+0x62/0xb0
 [&lt;c0104f83&gt;] kernel_thread_helper+0x7/0x14
 =======================
Module 'usbcore' failed to be added to sysfs, error number -17
The system will be unstable now.

Signed-off-by: Dave Young &lt;hidave.darkstar@gmail.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Chuck Ebbert &lt;cebbert@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

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