<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel, branch v4.9.10</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.10</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.9.10'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2017-02-14T23:25:43Z</updated>
<entry>
<title>perf/core: Fix crash in perf_event_read()</title>
<updated>2017-02-14T23:25:43Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2017-01-31T10:27:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e5c2e51470c2aadaf53a17acb677bb95529ac4d1'/>
<id>urn:sha1:e5c2e51470c2aadaf53a17acb677bb95529ac4d1</id>
<content type='text'>
commit 451d24d1e5f40bad000fa9abe36ddb16fc9928cb upstream.

Alexei had his box explode because doing read() on a package
(rapl/uncore) event that isn't currently scheduled in ends up doing an
out-of-bounds load.

Rework the code to more explicitly deal with event-&gt;oncpu being -1.

Reported-by: Alexei Starovoitov &lt;alexei.starovoitov@gmail.com&gt;
Tested-by: Alexei Starovoitov &lt;ast@kernel.org&gt;
Tested-by: David Carrillo-Cisneros &lt;davidcc@google.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: eranian@google.com
Fixes: d6a2f9035bfc ("perf/core: Introduce PMU_EV_CAP_READ_ACTIVE_PKG")
Link: http://lkml.kernel.org/r/20170131102710.GL6515@twins.programming.kicks-ass.net
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>stacktrace, lockdep: Fix address, newline ugliness</title>
<updated>2017-02-14T23:25:42Z</updated>
<author>
<name>Omar Sandoval</name>
<email>osandov@fb.com</email>
</author>
<published>2017-02-07T23:33:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6b4af0dab8934b046776a65fdd6e91658f500060'/>
<id>urn:sha1:6b4af0dab8934b046776a65fdd6e91658f500060</id>
<content type='text'>
commit bfeda41d06d85ad9d52f2413cfc2b77be5022f75 upstream.

Since KERN_CONT became meaningful again, lockdep stack traces have had
annoying extra newlines, like this:

[    5.561122] -&gt; #1 (B){+.+...}:
[    5.561528]
[    5.561532] [&lt;ffffffff810d8873&gt;] lock_acquire+0xc3/0x210
[    5.562178]
[    5.562181] [&lt;ffffffff816f6414&gt;] mutex_lock_nested+0x74/0x6d0
[    5.562861]
[    5.562880] [&lt;ffffffffa01aa3c3&gt;] init_btrfs_fs+0x21/0x196 [btrfs]
[    5.563717]
[    5.563721] [&lt;ffffffff81000472&gt;] do_one_initcall+0x52/0x1b0
[    5.564554]
[    5.564559] [&lt;ffffffff811a3af6&gt;] do_init_module+0x5f/0x209
[    5.565357]
[    5.565361] [&lt;ffffffff81122f4d&gt;] load_module+0x218d/0x2b80
[    5.566020]
[    5.566021] [&lt;ffffffff81123beb&gt;] SyS_finit_module+0xeb/0x120
[    5.566694]
[    5.566696] [&lt;ffffffff816fd241&gt;] entry_SYSCALL_64_fastpath+0x1f/0xc2

That's happening because each printk() call now gets printed on its own
line, and we do a separate call to print the spaces before the symbol.
Fix it by doing the printk() directly instead of using the
print_ip_sym() helper.

Additionally, the symbol address isn't very helpful, so let's get rid of
that, too. The final result looks like this:

[    5.194518] -&gt; #1 (B){+.+...}:
[    5.195002]        lock_acquire+0xc3/0x210
[    5.195439]        mutex_lock_nested+0x74/0x6d0
[    5.196491]        do_one_initcall+0x52/0x1b0
[    5.196939]        do_init_module+0x5f/0x209
[    5.197355]        load_module+0x218d/0x2b80
[    5.197792]        SyS_finit_module+0xeb/0x120
[    5.198251]        entry_SYSCALL_64_fastpath+0x1f/0xc2

Suggested-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Omar Sandoval &lt;osandov@fb.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: kernel-team@fb.com
Fixes: 4bcc595ccd80 ("printk: reinstate KERN_CONT for printing continuation lines")
Link: http://lkml.kernel.org/r/43b4e114724b2bdb0308fa86cb33aa07d3d67fad.1486510315.git.osandov@fb.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>irqdomain: Avoid activating interrupts more than once</title>
<updated>2017-02-09T07:08:31Z</updated>
<author>
<name>Marc Zyngier</name>
<email>marc.zyngier@arm.com</email>
</author>
<published>2017-01-17T16:00:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e02136282296dbc90f3c88b1cc5202ec0d5ed9f1'/>
<id>urn:sha1:e02136282296dbc90f3c88b1cc5202ec0d5ed9f1</id>
<content type='text'>
commit 08d85f3ea99f1eeafc4e8507936190e86a16ee8c upstream.

Since commit f3b0946d629c ("genirq/msi: Make sure PCI MSIs are
activated early"), we can end-up activating a PCI/MSI twice (once
at allocation time, and once at startup time).

This is normally of no consequences, except that there is some
HW out there that may misbehave if activate is used more than once
(the GICv3 ITS, for example, uses the activate callback
to issue the MAPVI command, and the architecture spec says that
"If there is an existing mapping for the EventID-DeviceID
combination, behavior is UNPREDICTABLE").

While this could be worked around in each individual driver, it may
make more sense to tackle the issue at the core level. In order to
avoid getting in that situation, let's have a per-interrupt flag
to remember if we have already activated that interrupt or not.

Fixes: f3b0946d629c ("genirq/msi: Make sure PCI MSIs are activated early")
Reported-and-tested-by: Andre Przywara &lt;andre.przywara@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
Link: http://lkml.kernel.org/r/1484668848-24361-1-git-send-email-marc.zyngier@arm.com
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>cgroup: don't online subsystems before cgroup_name/path() are operational</title>
<updated>2017-02-09T07:08:28Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2017-01-26T21:47:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1d88791d5ed5dae4ff8cbbf6147e90ff95d92ba9'/>
<id>urn:sha1:1d88791d5ed5dae4ff8cbbf6147e90ff95d92ba9</id>
<content type='text'>
commit 07cd12945551b63ecb1a349d50a6d69d1d6feb4a upstream.

While refactoring cgroup creation, a5bca2152036 ("cgroup: factor out
cgroup_create() out of cgroup_mkdir()") incorrectly onlined subsystems
before the new cgroup is associated with it kernfs_node.  This is fine
for cgroup proper but cgroup_name/path() depend on the associated
kernfs_node and if a subsystem makes the new cgroup_subsys_state
visible, which they're allowed to after onlining, it can lead to NULL
dereference.

The current code performs cgroup creation and subsystem onlining in
cgroup_create() and cgroup_mkdir() makes the cgroup and subsystems
visible afterwards.  There's no reason to online the subsystems early
and we can simply drop cgroup_apply_control_enable() call from
cgroup_create() so that the subsystems are onlined and made visible at
the same time.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Konstantin Khlebnikov &lt;khlebnikov@yandex-team.ru&gt;
Fixes: a5bca2152036 ("cgroup: factor out cgroup_create() out of cgroup_mkdir()")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tracing: Fix hwlat kthread migration</title>
<updated>2017-02-09T07:08:28Z</updated>
<author>
<name>Steven Rostedt (VMware)</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2017-01-31T00:27:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a93ae8dccc3c723ed7a629dab37a3392387acd79'/>
<id>urn:sha1:a93ae8dccc3c723ed7a629dab37a3392387acd79</id>
<content type='text'>
commit 79c6f448c8b79c321e4a1f31f98194e4f6b6cae7 upstream.

The hwlat tracer creates a kernel thread at start of the tracer. It is
pinned to a single CPU and will move to the next CPU after each period of
running. If the user modifies the migration thread's affinity, it will not
change after that happens.

The original code created the thread at the first instance it was called,
but later was changed to destroy the thread after the tracer was finished,
and would not be created until the next instance of the tracer was
established. The code that initialized the affinity was only called on the
initial instantiation of the tracer. After that, it was not initialized, and
the previous affinity did not match the current newly created one, making
it appear that the user modified the thread's affinity when it did not, and
the thread failed to migrate again.

Fixes: 0330f7aa8ee6 ("tracing: Have hwlat trace migrate across tracing_cpumask CPUs")
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>perf/core: Fix PERF_RECORD_MMAP2 prot/flags for anonymous memory</title>
<updated>2017-02-09T07:08:26Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2017-01-26T22:15:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b41615aa705626e0fbb5541e4715090370fe8c23'/>
<id>urn:sha1:b41615aa705626e0fbb5541e4715090370fe8c23</id>
<content type='text'>
commit 0b3589be9b98994ce3d5aeca52445d1f5627c4ba upstream.

Andres reported that MMAP2 records for anonymous memory always have
their protection field 0.

Turns out, someone daft put the prot/flags generation code in the file
branch, leaving them unset for anonymous memory.

Reported-by: Andres Freund &lt;andres@anarazel.de&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Don Zickus &lt;dzickus@redhat.com
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@gmail.com&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: acme@kernel.org
Cc: anton@ozlabs.org
Cc: namhyung@kernel.org
Fixes: f972eb63b100 ("perf: Pass protection and flags bits through mmap2 interface")
Link: http://lkml.kernel.org/r/20170126221508.GF6536@twins.programming.kicks-ass.net
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>perf/core: Fix use-after-free bug</title>
<updated>2017-02-09T07:08:26Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2017-01-26T15:39:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3996a91e3bdc04b6e41d93a7de3e5c6b63db5cb3'/>
<id>urn:sha1:3996a91e3bdc04b6e41d93a7de3e5c6b63db5cb3</id>
<content type='text'>
commit a76a82a3e38c8d3fb6499e3dfaeb0949241ab588 upstream.

Dmitry reported a KASAN use-after-free on event-&gt;group_leader.

It turns out there's a hole in perf_remove_from_context() due to
event_function_call() not calling its function when the task
associated with the event is already dead.

In this case the event will have been detached from the task, but the
grouping will have been retained, such that group operations might
still work properly while there are live child events etc.

This does however mean that we can miss a perf_group_detach() call
when the group decomposes, this in turn can then lead to
use-after-free.

Fix it by explicitly doing the group detach if its still required.

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Mathieu Desnoyers &lt;mathieu.desnoyers@efficios.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: syzkaller &lt;syzkaller@googlegroups.com&gt;
Fixes: 63b6da39bb38 ("perf: Fix perf_event_exit_task() race")
Link: http://lkml.kernel.org/r/20170126153955.GD6515@twins.programming.kicks-ass.net
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>perf/core: Fix concurrent sys_perf_event_open() vs. 'move_group' race</title>
<updated>2017-02-01T07:33:14Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2017-01-11T20:09:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=922813f4d66fb317e8602d058d03a1619af1ffd0'/>
<id>urn:sha1:922813f4d66fb317e8602d058d03a1619af1ffd0</id>
<content type='text'>
commit 321027c1fe77f892f4ea07846aeae08cefbbb290 upstream.

Di Shen reported a race between two concurrent sys_perf_event_open()
calls where both try and move the same pre-existing software group
into a hardware context.

The problem is exactly that described in commit:

  f63a8daa5812 ("perf: Fix event-&gt;ctx locking")

... where, while we wait for a ctx-&gt;mutex acquisition, the event-&gt;ctx
relation can have changed under us.

That very same commit failed to recognise sys_perf_event_context() as an
external access vector to the events and thereby didn't apply the
established locking rules correctly.

So while one sys_perf_event_open() call is stuck waiting on
mutex_lock_double(), the other (which owns said locks) moves the group
about. So by the time the former sys_perf_event_open() acquires the
locks, the context we've acquired is stale (and possibly dead).

Apply the established locking rules as per perf_event_ctx_lock_nested()
to the mutex_lock_double() for the 'move_group' case. This obviously means
we need to validate state after we acquire the locks.

Reported-by: Di Shen (Keen Lab)
Tested-by: John Dias &lt;joaodias@google.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Min Chong &lt;mchong@google.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
Fixes: f63a8daa5812 ("perf: Fix event-&gt;ctx locking")
Link: http://lkml.kernel.org/r/20170106131444.GZ3174@twins.programming.kicks-ass.net
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>sysctl: fix proc_doulongvec_ms_jiffies_minmax()</title>
<updated>2017-02-01T07:33:05Z</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2017-01-26T02:20:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=03707d6c36f9c7355c22e43039c09804e96a02b6'/>
<id>urn:sha1:03707d6c36f9c7355c22e43039c09804e96a02b6</id>
<content type='text'>
commit ff9f8a7cf935468a94d9927c68b00daae701667e upstream.

We perform the conversion between kernel jiffies and ms only when
exporting kernel value to user space.

We need to do the opposite operation when value is written by user.

Only matters when HZ != 1000

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&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>userns: Make ucounts lock irq-safe</title>
<updated>2017-02-01T07:33:05Z</updated>
<author>
<name>Nikolay Borisov</name>
<email>n.borisov.lkml@gmail.com</email>
</author>
<published>2017-01-20T13:21:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c7556867782ee8ae0383a1e99df09222f1f01332'/>
<id>urn:sha1:c7556867782ee8ae0383a1e99df09222f1f01332</id>
<content type='text'>
commit 880a38547ff08715ce4f1daf9a4bb30c87676e68 upstream.

The ucounts_lock is being used to protect various ucounts lifecycle
management functionalities. However, those services can also be invoked
when a pidns is being freed in an RCU callback (e.g. softirq context).
This can lead to deadlocks. There were already efforts trying to
prevent similar deadlocks in add7c65ca426 ("pid: fix lockdep deadlock
warning due to ucount_lock"), however they just moved the context
from hardirq to softrq. Fix this issue once and for all by explictly
making the lock disable irqs altogether.

Dmitry Vyukov &lt;dvyukov@google.com&gt; reported:

&gt; I've got the following deadlock report while running syzkaller fuzzer
&gt; on eec0d3d065bfcdf9cd5f56dd2a36b94d12d32297 of linux-next (on odroid
&gt; device if it matters):
&gt;
&gt; =================================
&gt; [ INFO: inconsistent lock state ]
&gt; 4.10.0-rc3-next-20170112-xc2-dirty #6 Not tainted
&gt; ---------------------------------
&gt; inconsistent {SOFTIRQ-ON-W} -&gt; {IN-SOFTIRQ-W} usage.
&gt; swapper/2/0 [HC0[0]:SC1[1]:HE1:SE0] takes:
&gt;  (ucounts_lock){+.?...}, at: [&lt;     inline     &gt;] spin_lock
&gt; ./include/linux/spinlock.h:302
&gt;  (ucounts_lock){+.?...}, at: [&lt;ffff2000081678c8&gt;]
&gt; put_ucounts+0x60/0x138 kernel/ucount.c:162
&gt; {SOFTIRQ-ON-W} state was registered at:
&gt; [&lt;ffff2000081c82d8&gt;] mark_lock+0x220/0xb60 kernel/locking/lockdep.c:3054
&gt; [&lt;     inline     &gt;] mark_irqflags kernel/locking/lockdep.c:2941
&gt; [&lt;ffff2000081c97a8&gt;] __lock_acquire+0x388/0x3260 kernel/locking/lockdep.c:3295
&gt; [&lt;ffff2000081cce24&gt;] lock_acquire+0xa4/0x138 kernel/locking/lockdep.c:3753
&gt; [&lt;     inline     &gt;] __raw_spin_lock ./include/linux/spinlock_api_smp.h:144
&gt; [&lt;ffff200009798128&gt;] _raw_spin_lock+0x90/0xd0 kernel/locking/spinlock.c:151
&gt; [&lt;     inline     &gt;] spin_lock ./include/linux/spinlock.h:302
&gt; [&lt;     inline     &gt;] get_ucounts kernel/ucount.c:131
&gt; [&lt;ffff200008167c28&gt;] inc_ucount+0x80/0x6c8 kernel/ucount.c:189
&gt; [&lt;     inline     &gt;] inc_mnt_namespaces fs/namespace.c:2818
&gt; [&lt;ffff200008481850&gt;] alloc_mnt_ns+0x78/0x3a8 fs/namespace.c:2849
&gt; [&lt;ffff200008487298&gt;] create_mnt_ns+0x28/0x200 fs/namespace.c:2959
&gt; [&lt;     inline     &gt;] init_mount_tree fs/namespace.c:3199
&gt; [&lt;ffff200009bd6674&gt;] mnt_init+0x258/0x384 fs/namespace.c:3251
&gt; [&lt;ffff200009bd60bc&gt;] vfs_caches_init+0x6c/0x80 fs/dcache.c:3626
&gt; [&lt;ffff200009bb1114&gt;] start_kernel+0x414/0x460 init/main.c:648
&gt; [&lt;ffff200009bb01e8&gt;] __primary_switched+0x6c/0x70 arch/arm64/kernel/head.S:456
&gt; irq event stamp: 2316924
&gt; hardirqs last  enabled at (2316924): [&lt;     inline     &gt;] rcu_do_batch
&gt; kernel/rcu/tree.c:2911
&gt; hardirqs last  enabled at (2316924): [&lt;     inline     &gt;]
&gt; invoke_rcu_callbacks kernel/rcu/tree.c:3182
&gt; hardirqs last  enabled at (2316924): [&lt;     inline     &gt;]
&gt; __rcu_process_callbacks kernel/rcu/tree.c:3149
&gt; hardirqs last  enabled at (2316924): [&lt;ffff200008210414&gt;]
&gt; rcu_process_callbacks+0x7a4/0xc28 kernel/rcu/tree.c:3166
&gt; hardirqs last disabled at (2316923): [&lt;     inline     &gt;] rcu_do_batch
&gt; kernel/rcu/tree.c:2900
&gt; hardirqs last disabled at (2316923): [&lt;     inline     &gt;]
&gt; invoke_rcu_callbacks kernel/rcu/tree.c:3182
&gt; hardirqs last disabled at (2316923): [&lt;     inline     &gt;]
&gt; __rcu_process_callbacks kernel/rcu/tree.c:3149
&gt; hardirqs last disabled at (2316923): [&lt;ffff20000820fe80&gt;]
&gt; rcu_process_callbacks+0x210/0xc28 kernel/rcu/tree.c:3166
&gt; softirqs last  enabled at (2316912): [&lt;ffff20000811b4c4&gt;]
&gt; _local_bh_enable+0x4c/0x80 kernel/softirq.c:155
&gt; softirqs last disabled at (2316913): [&lt;     inline     &gt;]
&gt; do_softirq_own_stack ./include/linux/interrupt.h:488
&gt; softirqs last disabled at (2316913): [&lt;     inline     &gt;]
&gt; invoke_softirq kernel/softirq.c:371
&gt; softirqs last disabled at (2316913): [&lt;ffff20000811c994&gt;]
&gt; irq_exit+0x264/0x308 kernel/softirq.c:405
&gt;
&gt; other info that might help us debug this:
&gt;  Possible unsafe locking scenario:
&gt;
&gt;        CPU0
&gt;        ----
&gt;   lock(ucounts_lock);
&gt;   &lt;Interrupt&gt;
&gt;     lock(ucounts_lock);
&gt;
&gt;  *** DEADLOCK ***
&gt;
&gt; 1 lock held by swapper/2/0:
&gt;  #0:  (rcu_callback){......}, at: [&lt;     inline     &gt;] __rcu_reclaim
&gt; kernel/rcu/rcu.h:108
&gt;  #0:  (rcu_callback){......}, at: [&lt;     inline     &gt;] rcu_do_batch
&gt; kernel/rcu/tree.c:2919
&gt;  #0:  (rcu_callback){......}, at: [&lt;     inline     &gt;]
&gt; invoke_rcu_callbacks kernel/rcu/tree.c:3182
&gt;  #0:  (rcu_callback){......}, at: [&lt;     inline     &gt;]
&gt; __rcu_process_callbacks kernel/rcu/tree.c:3149
&gt;  #0:  (rcu_callback){......}, at: [&lt;ffff200008210390&gt;]
&gt; rcu_process_callbacks+0x720/0xc28 kernel/rcu/tree.c:3166
&gt;
&gt; stack backtrace:
&gt; CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.10.0-rc3-next-20170112-xc2-dirty #6
&gt; Hardware name: Hardkernel ODROID-C2 (DT)
&gt; Call trace:
&gt; [&lt;ffff20000808fa60&gt;] dump_backtrace+0x0/0x440 arch/arm64/kernel/traps.c:500
&gt; [&lt;ffff20000808fec0&gt;] show_stack+0x20/0x30 arch/arm64/kernel/traps.c:225
&gt; [&lt;ffff2000088a99e0&gt;] dump_stack+0x110/0x168
&gt; [&lt;ffff2000082fa2b4&gt;] print_usage_bug.part.27+0x49c/0x4bc
&gt; kernel/locking/lockdep.c:2387
&gt; [&lt;     inline     &gt;] print_usage_bug kernel/locking/lockdep.c:2357
&gt; [&lt;     inline     &gt;] valid_state kernel/locking/lockdep.c:2400
&gt; [&lt;     inline     &gt;] mark_lock_irq kernel/locking/lockdep.c:2617
&gt; [&lt;ffff2000081c89ec&gt;] mark_lock+0x934/0xb60 kernel/locking/lockdep.c:3065
&gt; [&lt;     inline     &gt;] mark_irqflags kernel/locking/lockdep.c:2923
&gt; [&lt;ffff2000081c9a60&gt;] __lock_acquire+0x640/0x3260 kernel/locking/lockdep.c:3295
&gt; [&lt;ffff2000081cce24&gt;] lock_acquire+0xa4/0x138 kernel/locking/lockdep.c:3753
&gt; [&lt;     inline     &gt;] __raw_spin_lock ./include/linux/spinlock_api_smp.h:144
&gt; [&lt;ffff200009798128&gt;] _raw_spin_lock+0x90/0xd0 kernel/locking/spinlock.c:151
&gt; [&lt;     inline     &gt;] spin_lock ./include/linux/spinlock.h:302
&gt; [&lt;ffff2000081678c8&gt;] put_ucounts+0x60/0x138 kernel/ucount.c:162
&gt; [&lt;ffff200008168364&gt;] dec_ucount+0xf4/0x158 kernel/ucount.c:214
&gt; [&lt;     inline     &gt;] dec_pid_namespaces kernel/pid_namespace.c:89
&gt; [&lt;ffff200008293dc8&gt;] delayed_free_pidns+0x40/0xe0 kernel/pid_namespace.c:156
&gt; [&lt;     inline     &gt;] __rcu_reclaim kernel/rcu/rcu.h:118
&gt; [&lt;     inline     &gt;] rcu_do_batch kernel/rcu/tree.c:2919
&gt; [&lt;     inline     &gt;] invoke_rcu_callbacks kernel/rcu/tree.c:3182
&gt; [&lt;     inline     &gt;] __rcu_process_callbacks kernel/rcu/tree.c:3149
&gt; [&lt;ffff2000082103d8&gt;] rcu_process_callbacks+0x768/0xc28 kernel/rcu/tree.c:3166
&gt; [&lt;ffff2000080821dc&gt;] __do_softirq+0x324/0x6e0 kernel/softirq.c:284
&gt; [&lt;     inline     &gt;] do_softirq_own_stack ./include/linux/interrupt.h:488
&gt; [&lt;     inline     &gt;] invoke_softirq kernel/softirq.c:371
&gt; [&lt;ffff20000811c994&gt;] irq_exit+0x264/0x308 kernel/softirq.c:405
&gt; [&lt;ffff2000081ecc28&gt;] __handle_domain_irq+0xc0/0x150 kernel/irq/irqdesc.c:636
&gt; [&lt;ffff200008081c80&gt;] gic_handle_irq+0x68/0xd8
&gt; Exception stack(0xffff8000648e7dd0 to 0xffff8000648e7f00)
&gt; 7dc0:                                   ffff8000648d4b3c 0000000000000007
&gt; 7de0: 0000000000000000 1ffff0000c91a967 1ffff0000c91a967 1ffff0000c91a967
&gt; 7e00: ffff20000a4b6b68 0000000000000001 0000000000000007 0000000000000001
&gt; 7e20: 1fffe4000149ae90 ffff200009d35000 0000000000000000 0000000000000002
&gt; 7e40: 0000000000000000 0000000000000000 0000000002624a1a 0000000000000000
&gt; 7e60: 0000000000000000 ffff200009cbcd88 000060006d2ed000 0000000000000140
&gt; 7e80: ffff200009cff000 ffff200009cb6000 ffff200009cc2020 ffff200009d2159d
&gt; 7ea0: 0000000000000000 ffff8000648d4380 0000000000000000 ffff8000648e7f00
&gt; 7ec0: ffff20000820a478 ffff8000648e7f00 ffff20000820a47c 0000000010000145
&gt; 7ee0: 0000000000000140 dfff200000000000 ffffffffffffffff ffff20000820a478
&gt; [&lt;ffff2000080837f8&gt;] el1_irq+0xb8/0x130 arch/arm64/kernel/entry.S:486
&gt; [&lt;     inline     &gt;] arch_local_irq_restore
&gt; ./arch/arm64/include/asm/irqflags.h:81
&gt; [&lt;ffff20000820a47c&gt;] rcu_idle_exit+0x64/0xa8 kernel/rcu/tree.c:1030
&gt; [&lt;     inline     &gt;] cpuidle_idle_call kernel/sched/idle.c:200
&gt; [&lt;ffff2000081bcbfc&gt;] do_idle+0x1dc/0x2d0 kernel/sched/idle.c:243
&gt; [&lt;ffff2000081bd1cc&gt;] cpu_startup_entry+0x24/0x28 kernel/sched/idle.c:345
&gt; [&lt;ffff200008099f8c&gt;] secondary_start_kernel+0x2cc/0x358
&gt; arch/arm64/kernel/smp.c:276
&gt; [&lt;000000000279f1a4&gt;] 0x279f1a4

Reported-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Fixes: add7c65ca426 ("pid: fix lockdep deadlock warning due to ucount_lock")
Fixes: f333c700c610 ("pidns: Add a limit on the number of pid namespaces")
Link: https://www.spinics.net/lists/kernel/msg2426637.html
Signed-off-by: Nikolay Borisov &lt;n.borisov.lkml@gmail.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

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