<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel, branch v3.4.43</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel?h=v3.4.43</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel?h=v3.4.43'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-04-26T04:19:55Z</updated>
<entry>
<title>perf: Treat attr.config as u64 in perf_swevent_init()</title>
<updated>2013-04-26T04:19:55Z</updated>
<author>
<name>Tommi Rantala</name>
<email>tt.rantala@gmail.com</email>
</author>
<published>2013-04-13T19:49:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=da307d100cd4979e353e8265d0691263aa2a0086'/>
<id>urn:sha1:da307d100cd4979e353e8265d0691263aa2a0086</id>
<content type='text'>
commit 8176cced706b5e5d15887584150764894e94e02f upstream.

Trinity discovered that we fail to check all 64 bits of
attr.config passed by user space, resulting to out-of-bounds
access of the perf_swevent_enabled array in
sw_perf_event_destroy().

Introduced in commit b0a873ebb ("perf: Register PMU
implementations").

Signed-off-by: Tommi Rantala &lt;tt.rantala@gmail.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: davej@redhat.com
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@ghostprotocols.net&gt;
Link: http://lkml.kernel.org/r/1365882554-30259-1-git-send-email-tt.rantala@gmail.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>sched: Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s</title>
<updated>2013-04-26T04:19:55Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-03-18T19:22:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=410537558144cc886d780a02af9a09a122bff35b'/>
<id>urn:sha1:410537558144cc886d780a02af9a09a122bff35b</id>
<content type='text'>
commit 383efcd00053ec40023010ce5034bd702e7ab373 upstream.

try_to_wake_up_local() should only be invoked to wake up another
task in the same runqueue and BUG_ON()s are used to enforce the
rule. Missing try_to_wake_up_local() can stall workqueue
execution but such stalls are likely to be finite either by
another work item being queued or the one blocked getting
unblocked.  There's no reason to trigger BUG while holding rq
lock crashing the whole system.

Convert BUG_ON()s in try_to_wake_up_local() to WARN_ON_ONCE()s.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20130318192234.GD3042@htj.dyndns.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>kernel/signal.c: stop info leak via the tkill and the tgkill syscalls</title>
<updated>2013-04-26T04:19:54Z</updated>
<author>
<name>Emese Revfy</name>
<email>re.emese@gmail.com</email>
</author>
<published>2013-04-17T22:58:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cf276742f2dcdf5258aac98447e8b4b9fba55aaa'/>
<id>urn:sha1:cf276742f2dcdf5258aac98447e8b4b9fba55aaa</id>
<content type='text'>
commit b9e146d8eb3b9ecae5086d373b50fa0c1f3e7f0f upstream.

This fixes a kernel memory contents leak via the tkill and tgkill syscalls
for compat processes.

This is visible in the siginfo_t-&gt;_sifields._rt.si_sigval.sival_ptr field
when handling signals delivered from tkill.

The place of the infoleak:

int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from)
{
        ...
        put_user_ex(ptr_to_compat(from-&gt;si_ptr), &amp;to-&gt;si_ptr);
        ...
}

Signed-off-by: Emese Revfy &lt;re.emese@gmail.com&gt;
Reviewed-by: PaX Team &lt;pageexec@freemail.hu&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Serge Hallyn &lt;serge.hallyn@canonical.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@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>hrtimer: Don't reinitialize a cpu_base lock on CPU_UP</title>
<updated>2013-04-26T04:19:54Z</updated>
<author>
<name>Michael Bohan</name>
<email>mbohan@codeaurora.org</email>
</author>
<published>2013-03-20T02:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=110360768eb74d67bac851b7c0209a923258a314'/>
<id>urn:sha1:110360768eb74d67bac851b7c0209a923258a314</id>
<content type='text'>
commit 84cc8fd2fe65866e49d70b38b3fdf7219dd92fe0 upstream.

The current code makes the assumption that a cpu_base lock won't be
held if the CPU corresponding to that cpu_base is offline, which isn't
always true.

If a hrtimer is not queued, then it will not be migrated by
migrate_hrtimers() when a CPU is offlined. Therefore, the hrtimer's
cpu_base may still point to a CPU which has subsequently gone offline
if the timer wasn't enqueued at the time the CPU went down.

Normally this wouldn't be a problem, but a cpu_base's lock is blindly
reinitialized each time a CPU is brought up. If a CPU is brought
online during the period that another thread is performing a hrtimer
operation on a stale hrtimer, then the lock will be reinitialized
under its feet, and a SPIN_BUG() like the following will be observed:

&lt;0&gt;[   28.082085] BUG: spinlock already unlocked on CPU#0, swapper/0/0
&lt;0&gt;[   28.087078]  lock: 0xc4780b40, value 0x0 .magic: dead4ead, .owner: &lt;none&gt;/-1, .owner_cpu: -1
&lt;4&gt;[   42.451150] [&lt;c0014398&gt;] (unwind_backtrace+0x0/0x120) from [&lt;c0269220&gt;] (do_raw_spin_unlock+0x44/0xdc)
&lt;4&gt;[   42.460430] [&lt;c0269220&gt;] (do_raw_spin_unlock+0x44/0xdc) from [&lt;c071b5bc&gt;] (_raw_spin_unlock+0x8/0x30)
&lt;4&gt;[   42.469632] [&lt;c071b5bc&gt;] (_raw_spin_unlock+0x8/0x30) from [&lt;c00a9ce0&gt;] (__hrtimer_start_range_ns+0x1e4/0x4f8)
&lt;4&gt;[   42.479521] [&lt;c00a9ce0&gt;] (__hrtimer_start_range_ns+0x1e4/0x4f8) from [&lt;c00aa014&gt;] (hrtimer_start+0x20/0x28)
&lt;4&gt;[   42.489247] [&lt;c00aa014&gt;] (hrtimer_start+0x20/0x28) from [&lt;c00e6190&gt;] (rcu_idle_enter_common+0x1ac/0x320)
&lt;4&gt;[   42.498709] [&lt;c00e6190&gt;] (rcu_idle_enter_common+0x1ac/0x320) from [&lt;c00e6440&gt;] (rcu_idle_enter+0xa0/0xb8)
&lt;4&gt;[   42.508259] [&lt;c00e6440&gt;] (rcu_idle_enter+0xa0/0xb8) from [&lt;c000f268&gt;] (cpu_idle+0x24/0xf0)
&lt;4&gt;[   42.516503] [&lt;c000f268&gt;] (cpu_idle+0x24/0xf0) from [&lt;c06ed3c0&gt;] (rest_init+0x88/0xa0)
&lt;4&gt;[   42.524319] [&lt;c06ed3c0&gt;] (rest_init+0x88/0xa0) from [&lt;c0c00978&gt;] (start_kernel+0x3d0/0x434)

As an example, this particular crash occurred when hrtimer_start() was
executed on CPU #0. The code locked the hrtimer's current cpu_base
corresponding to CPU #1. CPU #0 then tried to switch the hrtimer's
cpu_base to an optimal CPU which was online. In this case, it selected
the cpu_base corresponding to CPU #3.

Before it could proceed, CPU #1 came online and reinitialized the
spinlock corresponding to its cpu_base. Thus now CPU #0 held a lock
which was reinitialized. When CPU #0 finally ended up unlocking the
old cpu_base corresponding to CPU #1 so that it could switch to CPU
#3, we hit this SPIN_BUG() above while in switch_hrtimer_base().

CPU #0                            CPU #1
----                              ----
...                               &lt;offline&gt;
hrtimer_start()
lock_hrtimer_base(base #1)
...                               init_hrtimers_cpu()
switch_hrtimer_base()             ...
...                               raw_spin_lock_init(&amp;cpu_base-&gt;lock)
raw_spin_unlock(&amp;cpu_base-&gt;lock)  ...
&lt;spin_bug&gt;

Solve this by statically initializing the lock.

Signed-off-by: Michael Bohan &lt;mbohan@codeaurora.org&gt;
Link: http://lkml.kernel.org/r/1363745965-23475-1-git-send-email-mbohan@codeaurora.org
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>sched_clock: Prevent 64bit inatomicity on 32bit systems</title>
<updated>2013-04-17T04:27:27Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2013-04-06T08:10:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fdd9ce008f3de39fa7fcd17717f1d7a0895269ea'/>
<id>urn:sha1:fdd9ce008f3de39fa7fcd17717f1d7a0895269ea</id>
<content type='text'>
commit a1cbcaa9ea87b87a96b9fc465951dcf36e459ca2 upstream.

The sched_clock_remote() implementation has the following inatomicity
problem on 32bit systems when accessing the remote scd-&gt;clock, which
is a 64bit value.

CPU0			CPU1

sched_clock_local()	sched_clock_remote(CPU0)
...
			remote_clock = scd[CPU0]-&gt;clock
			    read_low32bit(scd[CPU0]-&gt;clock)
cmpxchg64(scd-&gt;clock,...)
			    read_high32bit(scd[CPU0]-&gt;clock)

While the update of scd-&gt;clock is using an atomic64 mechanism, the
readout on the remote cpu is not, which can cause completely bogus
readouts.

It is a quite rare problem, because it requires the update to hit the
narrow race window between the low/high readout and the update must go
across the 32bit boundary.

The resulting misbehaviour is, that CPU1 will see the sched_clock on
CPU1 ~4 seconds ahead of it's own and update CPU1s sched_clock value
to this bogus timestamp. This stays that way due to the clamping
implementation for about 4 seconds until the synchronization with
CLOCK_MONOTONIC undoes the problem.

The issue is hard to observe, because it might only result in a less
accurate SCHED_OTHER timeslicing behaviour. To create observable
damage on realtime scheduling classes, it is necessary that the bogus
update of CPU1 sched_clock happens in the context of an realtime
thread, which then gets charged 4 seconds of RT runtime, which results
in the RT throttler mechanism to trigger and prevent scheduling of RT
tasks for a little less than 4 seconds. So this is quite unlikely as
well.

The issue was quite hard to decode as the reproduction time is between
2 days and 3 weeks and intrusive tracing makes it less likely, but the
following trace recorded with trace_clock=global, which uses
sched_clock_local(), gave the final hint:

  &lt;idle&gt;-0   0d..30 400269.477150: hrtimer_cancel: hrtimer=0xf7061e80
  &lt;idle&gt;-0   0d..30 400269.477151: hrtimer_start:  hrtimer=0xf7061e80 ...
irq/20-S-587 1d..32 400273.772118: sched_wakeup:   comm= ... target_cpu=0
  &lt;idle&gt;-0   0dN.30 400273.772118: hrtimer_cancel: hrtimer=0xf7061e80

What happens is that CPU0 goes idle and invokes
sched_clock_idle_sleep_event() which invokes sched_clock_local() and
CPU1 runs a remote wakeup for CPU0 at the same time, which invokes
sched_remote_clock(). The time jump gets propagated to CPU0 via
sched_remote_clock() and stays stale on both cores for ~4 seconds.

There are only two other possibilities, which could cause a stale
sched clock:

1) ktime_get() which reads out CLOCK_MONOTONIC returns a sporadic
   wrong value.

2) sched_clock() which reads the TSC returns a sporadic wrong value.

#1 can be excluded because sched_clock would continue to increase for
   one jiffy and then go stale.

#2 can be excluded because it would not make the clock jump
   forward. It would just result in a stale sched_clock for one jiffy.

After quite some brain twisting and finding the same pattern on other
traces, sched_clock_remote() remained the only place which could cause
such a problem and as explained above it's indeed racy on 32bit
systems.

So while on 64bit systems the readout is atomic, we need to verify the
remote readout on 32bit machines. We need to protect the local-&gt;clock
readout in sched_clock_remote() on 32bit as well because an NMI could
hit between the low and the high readout, call sched_clock_local() and
modify local-&gt;clock.

Thanks to Siegfried Wulsch for bearing with my debug requests and
going through the tedious tasks of running a bunch of reproducer
systems to generate the debug information which let me decode the
issue.

Reported-by: Siegfried Wulsch &lt;Siegfried.Wulsch@rovema.de&gt;
Acked-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1304051544160.21884@ionos
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>PM / reboot: call syscore_shutdown() after disable_nonboot_cpus()</title>
<updated>2013-04-17T04:27:26Z</updated>
<author>
<name>Huacai Chen</name>
<email>chenhc@lemote.com</email>
</author>
<published>2013-04-07T02:14:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e3573b2133637edf3a6cb39241e9270affa535c7'/>
<id>urn:sha1:e3573b2133637edf3a6cb39241e9270affa535c7</id>
<content type='text'>
commit 6f389a8f1dd22a24f3d9afc2812b30d639e94625 upstream.

As commit 40dc166c (PM / Core: Introduce struct syscore_ops for core
subsystems PM) say, syscore_ops operations should be carried with one
CPU on-line and interrupts disabled. However, after commit f96972f2d
(kernel/sys.c: call disable_nonboot_cpus() in kernel_restart()),
syscore_shutdown() is called before disable_nonboot_cpus(), so break
the rules. We have a MIPS machine with a 8259A PIC, and there is an
external timer (HPET) linked at 8259A. Since 8259A has been shutdown
too early (by syscore_shutdown()), disable_nonboot_cpus() runs without
timer interrupt, so it hangs and reboot fails. This patch call
syscore_shutdown() a little later (after disable_nonboot_cpus()) to
avoid reboot failure, this is the same way as poweroff does.

For consistency, add disable_nonboot_cpus() to kernel_halt().

Signed-off-by: Huacai Chen &lt;chenhc@lemote.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Fix double free when function profile init failed</title>
<updated>2013-04-17T04:27:26Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung.kim@lge.com</email>
</author>
<published>2013-04-01T12:46:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e264d3cf890eb1ead5200731b9e3dbd1d1b71fa8'/>
<id>urn:sha1:e264d3cf890eb1ead5200731b9e3dbd1d1b71fa8</id>
<content type='text'>
commit 83e03b3fe4daffdebbb42151d5410d730ae50bd1 upstream.

On the failure path, stat-&gt;start and stat-&gt;pages will refer same page.
So it'll attempt to free the same page again and get kernel panic.

Link: http://lkml.kernel.org/r/1364820385-32027-1-git-send-email-namhyung@kernel.org

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Namhyung Kim &lt;namhyung.kim@lge.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>panic: fix a possible deadlock in panic()</title>
<updated>2013-04-12T16:38:47Z</updated>
<author>
<name>Vikram Mulukutla</name>
<email>markivx@codeaurora.org</email>
</author>
<published>2012-07-30T21:39:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5592a94b44df6e6d48e34cfe596844637a2976ac'/>
<id>urn:sha1:5592a94b44df6e6d48e34cfe596844637a2976ac</id>
<content type='text'>
commit 190320c3b6640d4104650f55ff69611e050ea06b upstream.

panic_lock is meant to ensure that panic processing takes place only on
one cpu; if any of the other cpus encounter a panic, they will spin
waiting to be shut down.

However, this causes a regression in this scenario:

1. Cpu 0 encounters a panic and acquires the panic_lock
   and proceeds with the panic processing.
2. There is an interrupt on cpu 0 that also encounters
   an error condition and invokes panic.
3. This second invocation fails to acquire the panic_lock
   and enters the infinite while loop in panic_smp_self_stop.

Thus all panic processing is stopped, and the cpu is stuck for eternity
in the while(1) inside panic_smp_self_stop.

To address this, disable local interrupts with local_irq_disable before
acquiring the panic_lock.  This will prevent interrupt handlers from
executing during the panic processing, thus avoiding this particular
problem.

Signed-off-by: Vikram Mulukutla &lt;markivx@codeaurora.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Cc: Michael Holzheu &lt;holzheu@linux.vnet.ibm.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: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ftrace: Consistently restore trace function on sysctl enabling</title>
<updated>2013-04-12T16:38:45Z</updated>
<author>
<name>Jan Kiszka</name>
<email>jan.kiszka@siemens.com</email>
</author>
<published>2013-03-26T16:53:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b81d3241838167667fc1ec9bb5670d5f661a3628'/>
<id>urn:sha1:b81d3241838167667fc1ec9bb5670d5f661a3628</id>
<content type='text'>
commit 5000c418840b309251c5887f0b56503aae30f84c upstream.

If we reenable ftrace via syctl, we currently set ftrace_trace_function
based on the previous simplistic algorithm. This is inconsistent with
what update_ftrace_function does. So better call that helper instead.

Link: http://lkml.kernel.org/r/5151D26F.1070702@siemens.com

Signed-off-by: Jan Kiszka &lt;jan.kiszka@siemens.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Prevent buffer overwrite disabled for latency tracers</title>
<updated>2013-04-05T17:04:37Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-03-14T19:03:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7b7cf9fa6d3406c1c7410afa861d524f732e4a7c'/>
<id>urn:sha1:7b7cf9fa6d3406c1c7410afa861d524f732e4a7c</id>
<content type='text'>
commit 613f04a0f51e6e68ac6fe571ab79da3c0a5eb4da upstream.

The latency tracers require the buffers to be in overwrite mode,
otherwise they get screwed up. Force the buffers to stay in overwrite
mode when latency tracers are enabled.

Added a flag_changed() method to the tracer structure to allow
the tracers to see what flags are being changed, and also be able
to prevent the change from happing.

[Backported for 3.4-stable. Re-added current_trace NULL checks; removed
allocated_snapshot field; adapted to tracing_trace_options_write without
trace_set_options.]

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Lingzhu Xiang &lt;lxiang@redhat.com&gt;
Reviewed-by: CAI Qian &lt;caiqian@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

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