<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/security, branch v3.12.4</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>selinux: correct locking in selinux_netlbl_socket_connect)</title>
<updated>2013-12-04T19:05:40+00:00</updated>
<author>
<name>Paul Moore</name>
<email>pmoore@redhat.com</email>
</author>
<published>2013-09-26T21:00:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=34cc788ad044714f32e97687b2530e9b6ff7f56c'/>
<id>34cc788ad044714f32e97687b2530e9b6ff7f56c</id>
<content type='text'>
commit 42d64e1add3a1ce8a787116036163b8724362145 upstream.

The SELinux/NetLabel glue code has a locking bug that affects systems
with NetLabel enabled, see the kernel error message below.  This patch
corrects this problem by converting the bottom half socket lock to a
more conventional, and correct for this call-path, lock_sock() call.

 ===============================
 [ INFO: suspicious RCU usage. ]
 3.11.0-rc3+ #19 Not tainted
 -------------------------------
 net/ipv4/cipso_ipv4.c:1928 suspicious rcu_dereference_protected() usage!

 other info that might help us debug this:

 rcu_scheduler_active = 1, debug_locks = 0
 2 locks held by ping/731:
  #0:  (slock-AF_INET/1){+.-...}, at: [...] selinux_netlbl_socket_connect
  #1:  (rcu_read_lock){.+.+..}, at: [&lt;...&gt;] netlbl_conn_setattr

 stack backtrace:
 CPU: 1 PID: 731 Comm: ping Not tainted 3.11.0-rc3+ #19
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
  0000000000000001 ffff88006f659d28 ffffffff81726b6a ffff88003732c500
  ffff88006f659d58 ffffffff810e4457 ffff88006b845a00 0000000000000000
  000000000000000c ffff880075aa2f50 ffff88006f659d90 ffffffff8169bec7
 Call Trace:
  [&lt;ffffffff81726b6a&gt;] dump_stack+0x54/0x74
  [&lt;ffffffff810e4457&gt;] lockdep_rcu_suspicious+0xe7/0x120
  [&lt;ffffffff8169bec7&gt;] cipso_v4_sock_setattr+0x187/0x1a0
  [&lt;ffffffff8170f317&gt;] netlbl_conn_setattr+0x187/0x190
  [&lt;ffffffff8170f195&gt;] ? netlbl_conn_setattr+0x5/0x190
  [&lt;ffffffff8131ac9e&gt;] selinux_netlbl_socket_connect+0xae/0xc0
  [&lt;ffffffff81303025&gt;] selinux_socket_connect+0x135/0x170
  [&lt;ffffffff8119d127&gt;] ? might_fault+0x57/0xb0
  [&lt;ffffffff812fb146&gt;] security_socket_connect+0x16/0x20
  [&lt;ffffffff815d3ad3&gt;] SYSC_connect+0x73/0x130
  [&lt;ffffffff81739a85&gt;] ? sysret_check+0x22/0x5d
  [&lt;ffffffff810e5e2d&gt;] ? trace_hardirqs_on_caller+0xfd/0x1c0
  [&lt;ffffffff81373d4e&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f
  [&lt;ffffffff815d52be&gt;] SyS_connect+0xe/0x10
  [&lt;ffffffff81739a59&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Paul Moore &lt;pmoore@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 42d64e1add3a1ce8a787116036163b8724362145 upstream.

The SELinux/NetLabel glue code has a locking bug that affects systems
with NetLabel enabled, see the kernel error message below.  This patch
corrects this problem by converting the bottom half socket lock to a
more conventional, and correct for this call-path, lock_sock() call.

 ===============================
 [ INFO: suspicious RCU usage. ]
 3.11.0-rc3+ #19 Not tainted
 -------------------------------
 net/ipv4/cipso_ipv4.c:1928 suspicious rcu_dereference_protected() usage!

 other info that might help us debug this:

 rcu_scheduler_active = 1, debug_locks = 0
 2 locks held by ping/731:
  #0:  (slock-AF_INET/1){+.-...}, at: [...] selinux_netlbl_socket_connect
  #1:  (rcu_read_lock){.+.+..}, at: [&lt;...&gt;] netlbl_conn_setattr

 stack backtrace:
 CPU: 1 PID: 731 Comm: ping Not tainted 3.11.0-rc3+ #19
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
  0000000000000001 ffff88006f659d28 ffffffff81726b6a ffff88003732c500
  ffff88006f659d58 ffffffff810e4457 ffff88006b845a00 0000000000000000
  000000000000000c ffff880075aa2f50 ffff88006f659d90 ffffffff8169bec7
 Call Trace:
  [&lt;ffffffff81726b6a&gt;] dump_stack+0x54/0x74
  [&lt;ffffffff810e4457&gt;] lockdep_rcu_suspicious+0xe7/0x120
  [&lt;ffffffff8169bec7&gt;] cipso_v4_sock_setattr+0x187/0x1a0
  [&lt;ffffffff8170f317&gt;] netlbl_conn_setattr+0x187/0x190
  [&lt;ffffffff8170f195&gt;] ? netlbl_conn_setattr+0x5/0x190
  [&lt;ffffffff8131ac9e&gt;] selinux_netlbl_socket_connect+0xae/0xc0
  [&lt;ffffffff81303025&gt;] selinux_socket_connect+0x135/0x170
  [&lt;ffffffff8119d127&gt;] ? might_fault+0x57/0xb0
  [&lt;ffffffff812fb146&gt;] security_socket_connect+0x16/0x20
  [&lt;ffffffff815d3ad3&gt;] SYSC_connect+0x73/0x130
  [&lt;ffffffff81739a85&gt;] ? sysret_check+0x22/0x5d
  [&lt;ffffffff810e5e2d&gt;] ? trace_hardirqs_on_caller+0xfd/0x1c0
  [&lt;ffffffff81373d4e&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f
  [&lt;ffffffff815d52be&gt;] SyS_connect+0xe/0x10
  [&lt;ffffffff81739a59&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Paul Moore &lt;pmoore@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "ima: policy for RAMFS"</title>
<updated>2013-11-29T19:27:58+00:00</updated>
<author>
<name>Mimi Zohar</name>
<email>zohar@linux.vnet.ibm.com</email>
</author>
<published>2013-10-17T11:34:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=882f835f797e8912c0d927d1ba66498c76464724'/>
<id>882f835f797e8912c0d927d1ba66498c76464724</id>
<content type='text'>
commit 08de59eb144d7c41351a467442f898d720f0f15f upstream.

This reverts commit 4c2c392763a682354fac65b6a569adec4e4b5387.

Everything in the initramfs should be measured and appraised,
but until the initramfs has extended attribute support, at
least measured.

Signed-off-by: Mimi Zohar &lt;zohar@us.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 08de59eb144d7c41351a467442f898d720f0f15f upstream.

This reverts commit 4c2c392763a682354fac65b6a569adec4e4b5387.

Everything in the initramfs should be measured and appraised,
but until the initramfs has extended attribute support, at
least measured.

Signed-off-by: Mimi Zohar &lt;zohar@us.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>apparmor: fix bad lock balance when introspecting policy</title>
<updated>2013-10-16T00:54:01+00:00</updated>
<author>
<name>John Johansen</name>
<email>john.johansen@canonical.com</email>
</author>
<published>2013-10-14T18:46:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ed2c7da3a40c58410508fe24e12d03e508d7ec01'/>
<id>ed2c7da3a40c58410508fe24e12d03e508d7ec01</id>
<content type='text'>
BugLink: http://bugs.launchpad.net/bugs/1235977

The profile introspection seq file has a locking bug when policy is viewed
from a virtual root (task in a policy namespace), introspection from the
real root is not affected.

The test for root
    while (parent) {
is correct for the real root, but incorrect for tasks in a policy namespace.
This allows the task to walk backup the policy tree past its virtual root
causing it to be unlocked before the virtual root should be in the p_stop
fn.

This results in the following lockdep back trace:
[   78.479744] [ BUG: bad unlock balance detected! ]
[   78.479792] 3.11.0-11-generic #17 Not tainted
[   78.479838] -------------------------------------
[   78.479885] grep/2223 is trying to release lock (&amp;ns-&gt;lock) at:
[   78.479952] [&lt;ffffffff817bf3be&gt;] mutex_unlock+0xe/0x10
[   78.480002] but there are no more locks to release!
[   78.480037]
[   78.480037] other info that might help us debug this:
[   78.480037] 1 lock held by grep/2223:
[   78.480037]  #0:  (&amp;p-&gt;lock){+.+.+.}, at: [&lt;ffffffff812111bd&gt;] seq_read+0x3d/0x3d0
[   78.480037]
[   78.480037] stack backtrace:
[   78.480037] CPU: 0 PID: 2223 Comm: grep Not tainted 3.11.0-11-generic #17
[   78.480037] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[   78.480037]  ffffffff817bf3be ffff880007763d60 ffffffff817b97ef ffff8800189d2190
[   78.480037]  ffff880007763d88 ffffffff810e1c6e ffff88001f044730 ffff8800189d2190
[   78.480037]  ffffffff817bf3be ffff880007763e00 ffffffff810e5bd6 0000000724fe56b7
[   78.480037] Call Trace:
[   78.480037]  [&lt;ffffffff817bf3be&gt;] ? mutex_unlock+0xe/0x10
[   78.480037]  [&lt;ffffffff817b97ef&gt;] dump_stack+0x54/0x74
[   78.480037]  [&lt;ffffffff810e1c6e&gt;] print_unlock_imbalance_bug+0xee/0x100
[   78.480037]  [&lt;ffffffff817bf3be&gt;] ? mutex_unlock+0xe/0x10
[   78.480037]  [&lt;ffffffff810e5bd6&gt;] lock_release_non_nested+0x226/0x300
[   78.480037]  [&lt;ffffffff817bf2fe&gt;] ? __mutex_unlock_slowpath+0xce/0x180
[   78.480037]  [&lt;ffffffff817bf3be&gt;] ? mutex_unlock+0xe/0x10
[   78.480037]  [&lt;ffffffff810e5d5c&gt;] lock_release+0xac/0x310
[   78.480037]  [&lt;ffffffff817bf2b3&gt;] __mutex_unlock_slowpath+0x83/0x180
[   78.480037]  [&lt;ffffffff817bf3be&gt;] mutex_unlock+0xe/0x10
[   78.480037]  [&lt;ffffffff81376c91&gt;] p_stop+0x51/0x90
[   78.480037]  [&lt;ffffffff81211408&gt;] seq_read+0x288/0x3d0
[   78.480037]  [&lt;ffffffff811e9d9e&gt;] vfs_read+0x9e/0x170
[   78.480037]  [&lt;ffffffff811ea8cc&gt;] SyS_read+0x4c/0xa0
[   78.480037]  [&lt;ffffffff817ccc9d&gt;] system_call_fastpath+0x1a/0x1f

Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BugLink: http://bugs.launchpad.net/bugs/1235977

The profile introspection seq file has a locking bug when policy is viewed
from a virtual root (task in a policy namespace), introspection from the
real root is not affected.

The test for root
    while (parent) {
is correct for the real root, but incorrect for tasks in a policy namespace.
This allows the task to walk backup the policy tree past its virtual root
causing it to be unlocked before the virtual root should be in the p_stop
fn.

This results in the following lockdep back trace:
[   78.479744] [ BUG: bad unlock balance detected! ]
[   78.479792] 3.11.0-11-generic #17 Not tainted
[   78.479838] -------------------------------------
[   78.479885] grep/2223 is trying to release lock (&amp;ns-&gt;lock) at:
[   78.479952] [&lt;ffffffff817bf3be&gt;] mutex_unlock+0xe/0x10
[   78.480002] but there are no more locks to release!
[   78.480037]
[   78.480037] other info that might help us debug this:
[   78.480037] 1 lock held by grep/2223:
[   78.480037]  #0:  (&amp;p-&gt;lock){+.+.+.}, at: [&lt;ffffffff812111bd&gt;] seq_read+0x3d/0x3d0
[   78.480037]
[   78.480037] stack backtrace:
[   78.480037] CPU: 0 PID: 2223 Comm: grep Not tainted 3.11.0-11-generic #17
[   78.480037] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[   78.480037]  ffffffff817bf3be ffff880007763d60 ffffffff817b97ef ffff8800189d2190
[   78.480037]  ffff880007763d88 ffffffff810e1c6e ffff88001f044730 ffff8800189d2190
[   78.480037]  ffffffff817bf3be ffff880007763e00 ffffffff810e5bd6 0000000724fe56b7
[   78.480037] Call Trace:
[   78.480037]  [&lt;ffffffff817bf3be&gt;] ? mutex_unlock+0xe/0x10
[   78.480037]  [&lt;ffffffff817b97ef&gt;] dump_stack+0x54/0x74
[   78.480037]  [&lt;ffffffff810e1c6e&gt;] print_unlock_imbalance_bug+0xee/0x100
[   78.480037]  [&lt;ffffffff817bf3be&gt;] ? mutex_unlock+0xe/0x10
[   78.480037]  [&lt;ffffffff810e5bd6&gt;] lock_release_non_nested+0x226/0x300
[   78.480037]  [&lt;ffffffff817bf2fe&gt;] ? __mutex_unlock_slowpath+0xce/0x180
[   78.480037]  [&lt;ffffffff817bf3be&gt;] ? mutex_unlock+0xe/0x10
[   78.480037]  [&lt;ffffffff810e5d5c&gt;] lock_release+0xac/0x310
[   78.480037]  [&lt;ffffffff817bf2b3&gt;] __mutex_unlock_slowpath+0x83/0x180
[   78.480037]  [&lt;ffffffff817bf3be&gt;] mutex_unlock+0xe/0x10
[   78.480037]  [&lt;ffffffff81376c91&gt;] p_stop+0x51/0x90
[   78.480037]  [&lt;ffffffff81211408&gt;] seq_read+0x288/0x3d0
[   78.480037]  [&lt;ffffffff811e9d9e&gt;] vfs_read+0x9e/0x170
[   78.480037]  [&lt;ffffffff811ea8cc&gt;] SyS_read+0x4c/0xa0
[   78.480037]  [&lt;ffffffff817ccc9d&gt;] system_call_fastpath+0x1a/0x1f

Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>apparmor: fix memleak of the profile hash</title>
<updated>2013-10-16T00:53:59+00:00</updated>
<author>
<name>John Johansen</name>
<email>john.johansen@canonical.com</email>
</author>
<published>2013-10-14T18:44:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5cb3e91ebd0405519795f243adbfc4ed2a6fe53f'/>
<id>5cb3e91ebd0405519795f243adbfc4ed2a6fe53f</id>
<content type='text'>
BugLink: http://bugs.launchpad.net/bugs/1235523

This fixes the following kmemleak trace:
unreferenced object 0xffff8801e8c35680 (size 32):
  comm "apparmor_parser", pid 691, jiffies 4294895667 (age 13230.876s)
  hex dump (first 32 bytes):
    e0 d3 4e b5 ac 6d f4 ed 3f cb ee 48 1c fd 40 cf  ..N..m..?..H..@.
    5b cc e9 93 00 00 00 00 00 00 00 00 00 00 00 00  [...............
  backtrace:
    [&lt;ffffffff817a97ee&gt;] kmemleak_alloc+0x4e/0xb0
    [&lt;ffffffff811ca9f3&gt;] __kmalloc+0x103/0x290
    [&lt;ffffffff8138acbc&gt;] aa_calc_profile_hash+0x6c/0x150
    [&lt;ffffffff8138074d&gt;] aa_unpack+0x39d/0xd50
    [&lt;ffffffff8137eced&gt;] aa_replace_profiles+0x3d/0xd80
    [&lt;ffffffff81376937&gt;] profile_replace+0x37/0x50
    [&lt;ffffffff811e9f2d&gt;] vfs_write+0xbd/0x1e0
    [&lt;ffffffff811ea96c&gt;] SyS_write+0x4c/0xa0
    [&lt;ffffffff817ccb1d&gt;] system_call_fastpath+0x1a/0x1f
    [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff

Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BugLink: http://bugs.launchpad.net/bugs/1235523

This fixes the following kmemleak trace:
unreferenced object 0xffff8801e8c35680 (size 32):
  comm "apparmor_parser", pid 691, jiffies 4294895667 (age 13230.876s)
  hex dump (first 32 bytes):
    e0 d3 4e b5 ac 6d f4 ed 3f cb ee 48 1c fd 40 cf  ..N..m..?..H..@.
    5b cc e9 93 00 00 00 00 00 00 00 00 00 00 00 00  [...............
  backtrace:
    [&lt;ffffffff817a97ee&gt;] kmemleak_alloc+0x4e/0xb0
    [&lt;ffffffff811ca9f3&gt;] __kmalloc+0x103/0x290
    [&lt;ffffffff8138acbc&gt;] aa_calc_profile_hash+0x6c/0x150
    [&lt;ffffffff8138074d&gt;] aa_unpack+0x39d/0xd50
    [&lt;ffffffff8137eced&gt;] aa_replace_profiles+0x3d/0xd80
    [&lt;ffffffff81376937&gt;] profile_replace+0x37/0x50
    [&lt;ffffffff811e9f2d&gt;] vfs_write+0xbd/0x1e0
    [&lt;ffffffff811ea96c&gt;] SyS_write+0x4c/0xa0
    [&lt;ffffffff817ccb1d&gt;] system_call_fastpath+0x1a/0x1f
    [&lt;ffffffffffffffff&gt;] 0xffffffffffffffff

Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>selinux: remove 'flags' parameter from avc_audit()</title>
<updated>2013-10-04T21:13:25+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-10-04T21:05:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ab3540626435c01e08fe58ce544311a78430f112'/>
<id>ab3540626435c01e08fe58ce544311a78430f112</id>
<content type='text'>
Now avc_audit() has no more users with that parameter. Remove it.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now avc_audit() has no more users with that parameter. Remove it.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>selinux: avc_has_perm_flags has no more users</title>
<updated>2013-10-04T21:13:14+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-10-04T19:57:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cb4fbe5703be51f8a2dff4052b1901941ab99e12'/>
<id>cb4fbe5703be51f8a2dff4052b1901941ab99e12</id>
<content type='text'>
.. so get rid of it.  The only indirect users were all the
avc_has_perm() callers which just expanded to have a zero flags
argument.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
.. so get rid of it.  The only indirect users were all the
avc_has_perm() callers which just expanded to have a zero flags
argument.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>selinux: remove 'flags' parameter from inode_has_perm</title>
<updated>2013-10-04T19:54:11+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-10-04T19:54:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=19e49834d22c2271ed1f4a03aaa4b74986447fb4'/>
<id>19e49834d22c2271ed1f4a03aaa4b74986447fb4</id>
<content type='text'>
Every single user passes in '0'.  I think we had non-zero users back in
some stone age when selinux_inode_permission() was implemented in terms
of inode_has_perm(), but that complicated case got split up into a
totally separate code-path so that we could optimize the much simpler
special cases.

See commit 2e33405785d3 ("SELinux: delay initialization of audit data in
selinux_inode_permission") for example.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Every single user passes in '0'.  I think we had non-zero users back in
some stone age when selinux_inode_permission() was implemented in terms
of inode_has_perm(), but that complicated case got split up into a
totally separate code-path so that we could optimize the much simpler
special cases.

See commit 2e33405785d3 ("SELinux: delay initialization of audit data in
selinux_inode_permission") for example.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>apparmor: fix suspicious RCU usage warning in policy.c/policy.h</title>
<updated>2013-09-29T23:54:01+00:00</updated>
<author>
<name>John Johansen</name>
<email>john.johansen@canonical.com</email>
</author>
<published>2013-09-29T15:39:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4cd4fc77032dca46fe7475d81461e29145db247a'/>
<id>4cd4fc77032dca46fe7475d81461e29145db247a</id>
<content type='text'>
The recent 3.12 pull request for apparmor was missing a couple rcu _protected
access modifiers. Resulting in the follow suspicious RCU usage

 [   29.804534] [ INFO: suspicious RCU usage. ]
 [   29.804539] 3.11.0+ #5 Not tainted
 [   29.804541] -------------------------------
 [   29.804545] security/apparmor/include/policy.h:363 suspicious rcu_dereference_check() usage!
 [   29.804548]
 [   29.804548] other info that might help us debug this:
 [   29.804548]
 [   29.804553]
 [   29.804553] rcu_scheduler_active = 1, debug_locks = 1
 [   29.804558] 2 locks held by apparmor_parser/1268:
 [   29.804560]  #0:  (sb_writers#9){.+.+.+}, at: [&lt;ffffffff81120a4c&gt;] file_start_write+0x27/0x29
 [   29.804576]  #1:  (&amp;ns-&gt;lock){+.+.+.}, at: [&lt;ffffffff811f5d88&gt;] aa_replace_profiles+0x166/0x57c
 [   29.804589]
 [   29.804589] stack backtrace:
 [   29.804595] CPU: 0 PID: 1268 Comm: apparmor_parser Not tainted 3.11.0+ #5
 [   29.804599] Hardware name: ASUSTeK Computer Inc.         UL50VT          /UL50VT    , BIOS 217     03/01/2010
 [   29.804602]  0000000000000000 ffff8800b95a1d90 ffffffff8144eb9b ffff8800b94db540
 [   29.804611]  ffff8800b95a1dc0 ffffffff81087439 ffff880138cc3a18 ffff880138cc3a18
 [   29.804619]  ffff8800b9464a90 ffff880138cc3a38 ffff8800b95a1df0 ffffffff811f5084
 [   29.804628] Call Trace:
 [   29.804636]  [&lt;ffffffff8144eb9b&gt;] dump_stack+0x4e/0x82
 [   29.804642]  [&lt;ffffffff81087439&gt;] lockdep_rcu_suspicious+0xfc/0x105
 [   29.804649]  [&lt;ffffffff811f5084&gt;] __aa_update_replacedby+0x53/0x7f
 [   29.804655]  [&lt;ffffffff811f5408&gt;] __replace_profile+0x11f/0x1ed
 [   29.804661]  [&lt;ffffffff811f6032&gt;] aa_replace_profiles+0x410/0x57c
 [   29.804668]  [&lt;ffffffff811f16d4&gt;] profile_replace+0x35/0x4c
 [   29.804674]  [&lt;ffffffff81120fa3&gt;] vfs_write+0xad/0x113
 [   29.804680]  [&lt;ffffffff81121609&gt;] SyS_write+0x44/0x7a
 [   29.804687]  [&lt;ffffffff8145bfd2&gt;] system_call_fastpath+0x16/0x1b
 [   29.804691]
 [   29.804694] ===============================
 [   29.804697] [ INFO: suspicious RCU usage. ]
 [   29.804700] 3.11.0+ #5 Not tainted
 [   29.804703] -------------------------------
 [   29.804706] security/apparmor/policy.c:566 suspicious rcu_dereference_check() usage!
 [   29.804709]
 [   29.804709] other info that might help us debug this:
 [   29.804709]
 [   29.804714]
 [   29.804714] rcu_scheduler_active = 1, debug_locks = 1
 [   29.804718] 2 locks held by apparmor_parser/1268:
 [   29.804721]  #0:  (sb_writers#9){.+.+.+}, at: [&lt;ffffffff81120a4c&gt;] file_start_write+0x27/0x29
 [   29.804733]  #1:  (&amp;ns-&gt;lock){+.+.+.}, at: [&lt;ffffffff811f5d88&gt;] aa_replace_profiles+0x166/0x57c
 [   29.804744]
 [   29.804744] stack backtrace:
 [   29.804750] CPU: 0 PID: 1268 Comm: apparmor_parser Not tainted 3.11.0+ #5
 [   29.804753] Hardware name: ASUSTeK Computer Inc.         UL50VT          /UL50VT    , BIOS 217     03/01/2010
 [   29.804756]  0000000000000000 ffff8800b95a1d80 ffffffff8144eb9b ffff8800b94db540
 [   29.804764]  ffff8800b95a1db0 ffffffff81087439 ffff8800b95b02b0 0000000000000000
 [   29.804772]  ffff8800b9efba08 ffff880138cc3a38 ffff8800b95a1dd0 ffffffff811f4f94
 [   29.804779] Call Trace:
 [   29.804786]  [&lt;ffffffff8144eb9b&gt;] dump_stack+0x4e/0x82
 [   29.804791]  [&lt;ffffffff81087439&gt;] lockdep_rcu_suspicious+0xfc/0x105
 [   29.804798]  [&lt;ffffffff811f4f94&gt;] aa_free_replacedby_kref+0x4d/0x62
 [   29.804804]  [&lt;ffffffff811f4f47&gt;] ? aa_put_namespace+0x17/0x17
 [   29.804810]  [&lt;ffffffff811f4f0b&gt;] kref_put+0x36/0x40
 [   29.804816]  [&lt;ffffffff811f5423&gt;] __replace_profile+0x13a/0x1ed
 [   29.804822]  [&lt;ffffffff811f6032&gt;] aa_replace_profiles+0x410/0x57c
 [   29.804829]  [&lt;ffffffff811f16d4&gt;] profile_replace+0x35/0x4c
 [   29.804835]  [&lt;ffffffff81120fa3&gt;] vfs_write+0xad/0x113
 [   29.804840]  [&lt;ffffffff81121609&gt;] SyS_write+0x44/0x7a
 [   29.804847]  [&lt;ffffffff8145bfd2&gt;] system_call_fastpath+0x16/0x1b

Reported-by: miles.lane@gmail.com
CC: paulmck@linux.vnet.ibm.com
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The recent 3.12 pull request for apparmor was missing a couple rcu _protected
access modifiers. Resulting in the follow suspicious RCU usage

 [   29.804534] [ INFO: suspicious RCU usage. ]
 [   29.804539] 3.11.0+ #5 Not tainted
 [   29.804541] -------------------------------
 [   29.804545] security/apparmor/include/policy.h:363 suspicious rcu_dereference_check() usage!
 [   29.804548]
 [   29.804548] other info that might help us debug this:
 [   29.804548]
 [   29.804553]
 [   29.804553] rcu_scheduler_active = 1, debug_locks = 1
 [   29.804558] 2 locks held by apparmor_parser/1268:
 [   29.804560]  #0:  (sb_writers#9){.+.+.+}, at: [&lt;ffffffff81120a4c&gt;] file_start_write+0x27/0x29
 [   29.804576]  #1:  (&amp;ns-&gt;lock){+.+.+.}, at: [&lt;ffffffff811f5d88&gt;] aa_replace_profiles+0x166/0x57c
 [   29.804589]
 [   29.804589] stack backtrace:
 [   29.804595] CPU: 0 PID: 1268 Comm: apparmor_parser Not tainted 3.11.0+ #5
 [   29.804599] Hardware name: ASUSTeK Computer Inc.         UL50VT          /UL50VT    , BIOS 217     03/01/2010
 [   29.804602]  0000000000000000 ffff8800b95a1d90 ffffffff8144eb9b ffff8800b94db540
 [   29.804611]  ffff8800b95a1dc0 ffffffff81087439 ffff880138cc3a18 ffff880138cc3a18
 [   29.804619]  ffff8800b9464a90 ffff880138cc3a38 ffff8800b95a1df0 ffffffff811f5084
 [   29.804628] Call Trace:
 [   29.804636]  [&lt;ffffffff8144eb9b&gt;] dump_stack+0x4e/0x82
 [   29.804642]  [&lt;ffffffff81087439&gt;] lockdep_rcu_suspicious+0xfc/0x105
 [   29.804649]  [&lt;ffffffff811f5084&gt;] __aa_update_replacedby+0x53/0x7f
 [   29.804655]  [&lt;ffffffff811f5408&gt;] __replace_profile+0x11f/0x1ed
 [   29.804661]  [&lt;ffffffff811f6032&gt;] aa_replace_profiles+0x410/0x57c
 [   29.804668]  [&lt;ffffffff811f16d4&gt;] profile_replace+0x35/0x4c
 [   29.804674]  [&lt;ffffffff81120fa3&gt;] vfs_write+0xad/0x113
 [   29.804680]  [&lt;ffffffff81121609&gt;] SyS_write+0x44/0x7a
 [   29.804687]  [&lt;ffffffff8145bfd2&gt;] system_call_fastpath+0x16/0x1b
 [   29.804691]
 [   29.804694] ===============================
 [   29.804697] [ INFO: suspicious RCU usage. ]
 [   29.804700] 3.11.0+ #5 Not tainted
 [   29.804703] -------------------------------
 [   29.804706] security/apparmor/policy.c:566 suspicious rcu_dereference_check() usage!
 [   29.804709]
 [   29.804709] other info that might help us debug this:
 [   29.804709]
 [   29.804714]
 [   29.804714] rcu_scheduler_active = 1, debug_locks = 1
 [   29.804718] 2 locks held by apparmor_parser/1268:
 [   29.804721]  #0:  (sb_writers#9){.+.+.+}, at: [&lt;ffffffff81120a4c&gt;] file_start_write+0x27/0x29
 [   29.804733]  #1:  (&amp;ns-&gt;lock){+.+.+.}, at: [&lt;ffffffff811f5d88&gt;] aa_replace_profiles+0x166/0x57c
 [   29.804744]
 [   29.804744] stack backtrace:
 [   29.804750] CPU: 0 PID: 1268 Comm: apparmor_parser Not tainted 3.11.0+ #5
 [   29.804753] Hardware name: ASUSTeK Computer Inc.         UL50VT          /UL50VT    , BIOS 217     03/01/2010
 [   29.804756]  0000000000000000 ffff8800b95a1d80 ffffffff8144eb9b ffff8800b94db540
 [   29.804764]  ffff8800b95a1db0 ffffffff81087439 ffff8800b95b02b0 0000000000000000
 [   29.804772]  ffff8800b9efba08 ffff880138cc3a38 ffff8800b95a1dd0 ffffffff811f4f94
 [   29.804779] Call Trace:
 [   29.804786]  [&lt;ffffffff8144eb9b&gt;] dump_stack+0x4e/0x82
 [   29.804791]  [&lt;ffffffff81087439&gt;] lockdep_rcu_suspicious+0xfc/0x105
 [   29.804798]  [&lt;ffffffff811f4f94&gt;] aa_free_replacedby_kref+0x4d/0x62
 [   29.804804]  [&lt;ffffffff811f4f47&gt;] ? aa_put_namespace+0x17/0x17
 [   29.804810]  [&lt;ffffffff811f4f0b&gt;] kref_put+0x36/0x40
 [   29.804816]  [&lt;ffffffff811f5423&gt;] __replace_profile+0x13a/0x1ed
 [   29.804822]  [&lt;ffffffff811f6032&gt;] aa_replace_profiles+0x410/0x57c
 [   29.804829]  [&lt;ffffffff811f16d4&gt;] profile_replace+0x35/0x4c
 [   29.804835]  [&lt;ffffffff81120fa3&gt;] vfs_write+0xad/0x113
 [   29.804840]  [&lt;ffffffff81121609&gt;] SyS_write+0x44/0x7a
 [   29.804847]  [&lt;ffffffff8145bfd2&gt;] system_call_fastpath+0x16/0x1b

Reported-by: miles.lane@gmail.com
CC: paulmck@linux.vnet.ibm.com
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>apparmor: Use shash crypto API interface for profile hashes</title>
<updated>2013-09-29T23:53:59+00:00</updated>
<author>
<name>Tyler Hicks</name>
<email>tyhicks@canonical.com</email>
</author>
<published>2013-09-29T15:39:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=71ac7f6255c560716c20da8ee2c964bbd96e941f'/>
<id>71ac7f6255c560716c20da8ee2c964bbd96e941f</id>
<content type='text'>
Use the shash interface, rather than the hash interface, when hashing
AppArmor profiles. The shash interface does not use scatterlists and it
is a better fit for what AppArmor needs.

This fixes a kernel paging BUG when aa_calc_profile_hash() is passed a
buffer from vmalloc(). The hash interface requires callers to handle
vmalloc() buffers differently than what AppArmor was doing. Due to
vmalloc() memory not being physically contiguous, each individual page
behind the buffer must be assigned to a scatterlist with sg_set_page()
and then the scatterlist passed to crypto_hash_update().

The shash interface does not have that limitation and allows vmalloc()
and kmalloc() buffers to be handled in the same manner.

BugLink: https://launchpad.net/bugs/1216294/
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=62261

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Acked-by: Seth Arnold &lt;seth.arnold@canonical.com&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the shash interface, rather than the hash interface, when hashing
AppArmor profiles. The shash interface does not use scatterlists and it
is a better fit for what AppArmor needs.

This fixes a kernel paging BUG when aa_calc_profile_hash() is passed a
buffer from vmalloc(). The hash interface requires callers to handle
vmalloc() buffers differently than what AppArmor was doing. Due to
vmalloc() memory not being physically contiguous, each individual page
behind the buffer must be assigned to a scatterlist with sg_set_page()
and then the scatterlist passed to crypto_hash_update().

The shash interface does not have that limitation and allows vmalloc()
and kmalloc() buffers to be handled in the same manner.

BugLink: https://launchpad.net/bugs/1216294/
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=62261

Signed-off-by: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Acked-by: Seth Arnold &lt;seth.arnold@canonical.com&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace</title>
<updated>2013-09-07T21:35:32+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-09-07T21:35:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=c7c4591db64dbd1e504bc4e2806d7ef290a3c81b'/>
<id>c7c4591db64dbd1e504bc4e2806d7ef290a3c81b</id>
<content type='text'>
Pull namespace changes from Eric Biederman:
 "This is an assorted mishmash of small cleanups, enhancements and bug
  fixes.

  The major theme is user namespace mount restrictions.  nsown_capable
  is killed as it encourages not thinking about details that need to be
  considered.  A very hard to hit pid namespace exiting bug was finally
  tracked and fixed.  A couple of cleanups to the basic namespace
  infrastructure.

  Finally there is an enhancement that makes per user namespace
  capabilities usable as capabilities, and an enhancement that allows
  the per userns root to nice other processes in the user namespace"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  userns:  Kill nsown_capable it makes the wrong thing easy
  capabilities: allow nice if we are privileged
  pidns: Don't have unshare(CLONE_NEWPID) imply CLONE_THREAD
  userns: Allow PR_CAPBSET_DROP in a user namespace.
  namespaces: Simplify copy_namespaces so it is clear what is going on.
  pidns: Fix hang in zap_pid_ns_processes by sending a potentially extra wakeup
  sysfs: Restrict mounting sysfs
  userns: Better restrictions on when proc and sysfs can be mounted
  vfs: Don't copy mount bind mounts of /proc/&lt;pid&gt;/ns/mnt between namespaces
  kernel/nsproxy.c: Improving a snippet of code.
  proc: Restrict mounting the proc filesystem
  vfs: Lock in place mounts from more privileged users
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull namespace changes from Eric Biederman:
 "This is an assorted mishmash of small cleanups, enhancements and bug
  fixes.

  The major theme is user namespace mount restrictions.  nsown_capable
  is killed as it encourages not thinking about details that need to be
  considered.  A very hard to hit pid namespace exiting bug was finally
  tracked and fixed.  A couple of cleanups to the basic namespace
  infrastructure.

  Finally there is an enhancement that makes per user namespace
  capabilities usable as capabilities, and an enhancement that allows
  the per userns root to nice other processes in the user namespace"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  userns:  Kill nsown_capable it makes the wrong thing easy
  capabilities: allow nice if we are privileged
  pidns: Don't have unshare(CLONE_NEWPID) imply CLONE_THREAD
  userns: Allow PR_CAPBSET_DROP in a user namespace.
  namespaces: Simplify copy_namespaces so it is clear what is going on.
  pidns: Fix hang in zap_pid_ns_processes by sending a potentially extra wakeup
  sysfs: Restrict mounting sysfs
  userns: Better restrictions on when proc and sysfs can be mounted
  vfs: Don't copy mount bind mounts of /proc/&lt;pid&gt;/ns/mnt between namespaces
  kernel/nsproxy.c: Improving a snippet of code.
  proc: Restrict mounting the proc filesystem
  vfs: Lock in place mounts from more privileged users
</pre>
</div>
</content>
</entry>
</feed>
