<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/security, branch v3.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2012-11-21T10:55:32Z</updated>
<entry>
<title>selinux: fix sel_netnode_insert() suspicious rcu dereference</title>
<updated>2012-11-21T10:55:32Z</updated>
<author>
<name>Dave Jones</name>
<email>davej@redhat.com</email>
</author>
<published>2012-11-09T00:09:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=88a693b5c1287be4da937699cb82068ce9db0135'/>
<id>urn:sha1:88a693b5c1287be4da937699cb82068ce9db0135</id>
<content type='text'>
===============================
[ INFO: suspicious RCU usage. ]
3.5.0-rc1+ #63 Not tainted
-------------------------------
security/selinux/netnode.c:178 suspicious rcu_dereference_check() usage!

other info that might help us debug this:

rcu_scheduler_active = 1, debug_locks = 0
1 lock held by trinity-child1/8750:
 #0:  (sel_netnode_lock){+.....}, at: [&lt;ffffffff812d8f8a&gt;] sel_netnode_sid+0x16a/0x3e0

stack backtrace:
Pid: 8750, comm: trinity-child1 Not tainted 3.5.0-rc1+ #63
Call Trace:
 [&lt;ffffffff810cec2d&gt;] lockdep_rcu_suspicious+0xfd/0x130
 [&lt;ffffffff812d91d1&gt;] sel_netnode_sid+0x3b1/0x3e0
 [&lt;ffffffff812d8e20&gt;] ? sel_netnode_find+0x1a0/0x1a0
 [&lt;ffffffff812d24a6&gt;] selinux_socket_bind+0xf6/0x2c0
 [&lt;ffffffff810cd1dd&gt;] ? trace_hardirqs_off+0xd/0x10
 [&lt;ffffffff810cdb55&gt;] ? lock_release_holdtime.part.9+0x15/0x1a0
 [&lt;ffffffff81093841&gt;] ? lock_hrtimer_base+0x31/0x60
 [&lt;ffffffff812c9536&gt;] security_socket_bind+0x16/0x20
 [&lt;ffffffff815550ca&gt;] sys_bind+0x7a/0x100
 [&lt;ffffffff816c03d5&gt;] ? sysret_check+0x22/0x5d
 [&lt;ffffffff810d392d&gt;] ? trace_hardirqs_on_caller+0x10d/0x1a0
 [&lt;ffffffff8133b09e&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [&lt;ffffffff816c03a9&gt;] system_call_fastpath+0x16/0x1b

This patch below does what Paul McKenney suggested in the previous thread.

Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
Reviewed-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Acked-by: Paul Moore &lt;paul@paul-moore.com&gt;
Cc: Eric Paris &lt;eparis@parisplace.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</content>
</entry>
<entry>
<title>device_cgroup: fix RCU usage</title>
<updated>2012-11-06T20:25:51Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-11-06T17:17:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=201e72acb2d3821e2de9ce6091e98859c316b29a'/>
<id>urn:sha1:201e72acb2d3821e2de9ce6091e98859c316b29a</id>
<content type='text'>
dev_cgroup-&gt;exceptions is protected with devcgroup_mutex for writes
and RCU for reads; however, RCU usage isn't correct.

* dev_exception_clean() doesn't use RCU variant of list_del() and
  kfree().  The function can race with may_access() and may_access()
  may end up dereferencing already freed memory.  Use list_del_rcu()
  and kfree_rcu() instead.

* may_access() may be called only with RCU read locked but doesn't use
  RCU safe traversal over -&gt;exceptions.  Use list_for_each_entry_rcu().

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Serge E. Hallyn &lt;serge.hallyn@ubuntu.com&gt;
Cc: stable@vger.kernel.org
Cc: Aristeu Rozanski &lt;aris@redhat.com&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>device_cgroup: fix unchecked cgroup parent usage</title>
<updated>2012-11-06T15:25:20Z</updated>
<author>
<name>Aristeu Rozanski</name>
<email>aris@redhat.com</email>
</author>
<published>2012-11-06T15:25:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=64e104771351d365e51e588a0e9a656ae6ed2f50'/>
<id>urn:sha1:64e104771351d365e51e588a0e9a656ae6ed2f50</id>
<content type='text'>
In 4cef7299b478687 ("device_cgroup: add proper checking when changing
default behavior") the cgroup parent usage is unchecked.  root will not
have a parent and trying to use device.{allow,deny} will cause problems.
For some reason my stressing scripts didn't test the root directory so I
didn't catch it on my regular tests.

Signed-off-by: Aristeu Rozanski &lt;aris@redhat.com&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Acked-by: Serge E. Hallyn &lt;serge.hallyn@ubuntu.com&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>device_cgroup: add proper checking when changing default behavior</title>
<updated>2012-10-25T21:37:52Z</updated>
<author>
<name>Aristeu Rozanski</name>
<email>aris@redhat.com</email>
</author>
<published>2012-10-25T20:37:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4cef7299b4786879a3e113e84084a72b24590c5b'/>
<id>urn:sha1:4cef7299b4786879a3e113e84084a72b24590c5b</id>
<content type='text'>
Before changing a group's default behavior to ALLOW, we must check if
its parent's behavior is also ALLOW.

Signed-off-by: Aristeu Rozanski &lt;aris@redhat.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>device_cgroup: stop using simple_strtoul()</title>
<updated>2012-10-25T21:37:52Z</updated>
<author>
<name>Aristeu Rozanski</name>
<email>aris@redhat.com</email>
</author>
<published>2012-10-25T20:37:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=26fd8405dd470cb8b54cb96859b7dd437e5e1391'/>
<id>urn:sha1:26fd8405dd470cb8b54cb96859b7dd437e5e1391</id>
<content type='text'>
Convert the code to use kstrtou32() instead of simple_strtoul() which is
deprecated.  The real size of the variables are u32, so use kstrtou32
instead of kstrtoul

Signed-off-by: Aristeu Rozanski &lt;aris@redhat.com&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>device_cgroup: rename deny_all to behavior</title>
<updated>2012-10-25T21:37:52Z</updated>
<author>
<name>Aristeu Rozanski</name>
<email>aris@redhat.com</email>
</author>
<published>2012-10-25T20:37:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5b7aa7d5bb2c5cf7fc05aaa41561af321706ab5f'/>
<id>urn:sha1:5b7aa7d5bb2c5cf7fc05aaa41561af321706ab5f</id>
<content type='text'>
This was done in a v2 patch but v1 ended up being committed.  The
variable name is less confusing and stores the default behavior when no
matching exception exists.

Signed-off-by: Aristeu Rozanski &lt;aris@redhat.com&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: Jiri Slaby &lt;jslaby@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>cgroup: fix invalid rcu dereference</title>
<updated>2012-10-25T21:37:52Z</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2012-10-25T20:37:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8c9506d16925f1b1314d93af383ca3134eb534d8'/>
<id>urn:sha1:8c9506d16925f1b1314d93af383ca3134eb534d8</id>
<content type='text'>
Commit ad676077a2ae ("device_cgroup: convert device_cgroup internally to
policy + exceptions") removed rcu locks which are needed in
task_devcgroup called in this chain:

  devcgroup_inode_mknod OR __devcgroup_inode_permission -&gt;
    __devcgroup_inode_permission -&gt;
      task_devcgroup -&gt;
        task_subsys_state -&gt;
          task_subsys_state_check.

Change the code so that task_devcgroup is safely called with rcu read
lock held.

  ===============================
  [ INFO: suspicious RCU usage. ]
  3.6.0-rc5-next-20120913+ #42 Not tainted
  -------------------------------
  include/linux/cgroup.h:553 suspicious rcu_dereference_check() usage!

  other info that might help us debug this:

  rcu_scheduler_active = 1, debug_locks = 0
  2 locks held by kdevtmpfs/23:
   #0:  (sb_writers){.+.+.+}, at: [&lt;ffffffff8116873f&gt;]
  mnt_want_write+0x1f/0x50
   #1:  (&amp;sb-&gt;s_type-&gt;i_mutex_key#3/1){+.+.+.}, at: [&lt;ffffffff811558af&gt;]
  kern_path_create+0x7f/0x170

  stack backtrace:
  Pid: 23, comm: kdevtmpfs Not tainted 3.6.0-rc5-next-20120913+ #42
  Call Trace:
    lockdep_rcu_suspicious+0xfd/0x130
    devcgroup_inode_mknod+0x19d/0x240
    vfs_mknod+0x71/0xf0
    handle_create.isra.2+0x72/0x200
    devtmpfsd+0x114/0x140
    ? handle_create.isra.2+0x200/0x200
    kthread+0xd6/0xe0
    kernel_thread_helper+0x4/0x10

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: Dave Jones &lt;davej@redhat.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Li Zefan &lt;lizefan@huawei.com&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Acked-by: 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;
</content>
</entry>
<entry>
<title>apparmor: fix IRQ stack overflow during free_profile</title>
<updated>2012-10-24T15:12:50Z</updated>
<author>
<name>John Johansen</name>
<email>john.johansen@canonical.com</email>
</author>
<published>2012-10-24T13:27:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e680dd61e80592385338bfbeb86833d1c60546c'/>
<id>urn:sha1:2e680dd61e80592385338bfbeb86833d1c60546c</id>
<content type='text'>
BugLink: http://bugs.launchpad.net/bugs/1056078

Profile replacement can cause long chains of profiles to build up when
the profile being replaced is pinned. When the pinned profile is finally
freed, it puts the reference to its replacement, which may in turn nest
another call to free_profile on the stack. Because this may happen for
each profile in the replacedby chain this can result in a recusion that
causes the stack to overflow.

Break this nesting by directly walking the chain of replacedby profiles
(ie. use iteration instead of recursion to free the list). This results
in at most 2 levels of free_profile being called, while freeing a
replacedby chain.

Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;james.l.morris@oracle.com&gt;
</content>
</entry>
<entry>
<title>apparmor: fix apparmor OOPS in audit_log_untrustedstring+0x1c/0x40</title>
<updated>2012-10-17T23:29:46Z</updated>
<author>
<name>John Johansen</name>
<email>john.johansen@canonical.com</email>
</author>
<published>2012-10-17T20:29:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=43c422eda99b894f18d1cca17bcd2401efaf7bd0'/>
<id>urn:sha1:43c422eda99b894f18d1cca17bcd2401efaf7bd0</id>
<content type='text'>
The capability defines have moved causing the auto generated names
of capabilities that apparmor uses in logging to be incorrect.

Fix the autogenerated table source to uapi/linux/capability.h

Reported-by: YanHong &lt;clouds.yan@gmail.com&gt;
Reported-by: Krzysztof Kolasa &lt;kkolasa@winsoft.pl&gt;
Analyzed-by: Al Viro &lt;viro@ZenIV.linux.org.uk&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Acked-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: James Morris &lt;james.l.morris@oracle.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fix a leak in replace_fd() users</title>
<updated>2012-10-16T17:36:50Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2012-10-16T17:30:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=45525b26a46cd593cb72070304c4cd7c8391bd37'/>
<id>urn:sha1:45525b26a46cd593cb72070304c4cd7c8391bd37</id>
<content type='text'>
replace_fd() began with "eats a reference, tries to insert into
descriptor table" semantics; at some point I'd switched it to
much saner current behaviour ("try to insert into descriptor
table, grabbing a new reference if inserted; caller should do
fput() in any case"), but forgot to update the callers.
Mea culpa...

[Spotted by Pavel Roskin, who has really weird system with pipe-fed
coredumps as part of what he considers a normal boot ;-)]

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
