<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/security, branch v2.6.34.10</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/security?h=v2.6.34.10</id>
<link rel='self' href='https://git.amat.us/linux/atom/security?h=v2.6.34.10'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-06-26T16:46:42Z</updated>
<entry>
<title>CRED: Fix BUG() upon security_cred_alloc_blank() failure</title>
<updated>2011-06-26T16:46:42Z</updated>
<author>
<name>Tetsuo Handa</name>
<email>penguin-kernel@I-love.SAKURA.ne.jp</email>
</author>
<published>2011-02-07T13:36:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=66b29b835482062342f6b6ac6785646d0997235f'/>
<id>urn:sha1:66b29b835482062342f6b6ac6785646d0997235f</id>
<content type='text'>
commit 2edeaa34a6e3f2c43b667f6c4f7b27944b811695 upstream.

In cred_alloc_blank() since 2.6.32, abort_creds(new) is called with
new-&gt;security == NULL and new-&gt;magic == 0 when security_cred_alloc_blank()
returns an error.  As a result, BUG() will be triggered if SELinux is enabled
or CONFIG_DEBUG_CREDENTIALS=y.

If CONFIG_DEBUG_CREDENTIALS=y, BUG() is called from __invalid_creds() because
cred-&gt;magic == 0.  Failing that, BUG() is called from selinux_cred_free()
because selinux_cred_free() is not expecting cred-&gt;security == NULL.  This does
not affect smack_cred_free(), tomoyo_cred_free() or apparmor_cred_free().

Fix these bugs by

(1) Set new-&gt;magic before calling security_cred_alloc_blank().

(2) Handle null cred-&gt;security in creds_are_invalid() and selinux_cred_free().

Signed-off-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>SELinux: do not compute transition labels on mountpoint labeled filesystems</title>
<updated>2011-06-26T16:46:34Z</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2010-12-02T21:13:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c2d3969834598a76835a0885cbc8e47be2ec691a'/>
<id>urn:sha1:c2d3969834598a76835a0885cbc8e47be2ec691a</id>
<content type='text'>
commit 415103f9932d45f7927f4b17e3a9a13834cdb9a1 upstream.

selinux_inode_init_security computes transitions sids even for filesystems
that use mount point labeling.  It shouldn't do that.  It should just use
the mount point label always and no matter what.

This causes 2 problems.  1) it makes file creation slower than it needs to be
since we calculate the transition sid and 2) it allows files to be created
with a different label than the mount point!

# id -Z
staff_u:sysadm_r:sysadm_t:s0-s0:c0.c1023
# sesearch --type --class file --source sysadm_t --target tmp_t
Found 1 semantic te rules:
   type_transition sysadm_t tmp_t : file user_tmp_t;

# mount -o loop,context="system_u:object_r:tmp_t:s0"  /tmp/fs /mnt/tmp

# ls -lZ /mnt/tmp
drwx------. root root system_u:object_r:tmp_t:s0       lost+found
# touch /mnt/tmp/file1
# ls -lZ /mnt/tmp
-rw-r--r--. root root staff_u:object_r:user_tmp_t:s0   file1
drwx------. root root system_u:object_r:tmp_t:s0       lost+found

Whoops, we have a mount point labeled filesystem tmp_t with a user_tmp_t
labeled file!

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Reviewed-by: Reviewed-by: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>SELinux: define permissions for DCB netlink messages</title>
<updated>2011-06-26T16:46:34Z</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2010-12-16T16:46:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3234864e563a863354299a73cdaccab08f69d058'/>
<id>urn:sha1:3234864e563a863354299a73cdaccab08f69d058</id>
<content type='text'>
commit 350e4f31e0eaf56dfc3b328d24a11bdf42a41fb8 upstream.

Commit 2f90b865 added two new netlink message types to the netlink route
socket.  SELinux has hooks to define if netlink messages are allowed to
be sent or received, but it did not know about these two new message
types.  By default we allow such actions so noone likely noticed.  This
patch adds the proper definitions and thus proper permissions
enforcement.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>ima: fix add LSM rule bug</title>
<updated>2011-04-17T20:16:14Z</updated>
<author>
<name>Mimi Zohar</name>
<email>zohar@linux.vnet.ibm.com</email>
</author>
<published>2011-01-03T22:59:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cd67d1519ad905f4df99d72faa124617cb62c039'/>
<id>urn:sha1:cd67d1519ad905f4df99d72faa124617cb62c039</id>
<content type='text'>
commit 867c20265459d30a01b021a9c1e81fb4c5832aa9 upstream.

If security_filter_rule_init() doesn't return a rule, then not everything
is as fine as the return code implies.

This bug only occurs when the LSM (eg. SELinux) is disabled at runtime.

Adding an empty LSM rule causes ima_match_rules() to always succeed,
ignoring any remaining rules.

 default IMA TCB policy:
  # PROC_SUPER_MAGIC
  dont_measure fsmagic=0x9fa0
  # SYSFS_MAGIC
  dont_measure fsmagic=0x62656572
  # DEBUGFS_MAGIC
  dont_measure fsmagic=0x64626720
  # TMPFS_MAGIC
  dont_measure fsmagic=0x01021994
  # SECURITYFS_MAGIC
  dont_measure fsmagic=0x73636673

  &lt; LSM specific rule &gt;
  dont_measure obj_type=var_log_t

  measure func=BPRM_CHECK
  measure func=FILE_MMAP mask=MAY_EXEC
  measure func=FILE_CHECK mask=MAY_READ uid=0

Thus without the patch, with the boot parameters 'tcb selinux=0', adding
the above 'dont_measure obj_type=var_log_t' rule to the default IMA TCB
measurement policy, would result in nothing being measured.  The patch
prevents the default TCB policy from being replaced.

Signed-off-by: Mimi Zohar &lt;zohar@us.ibm.com&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Acked-by: Serge Hallyn &lt;serge.hallyn@canonical.com&gt;
Cc: David Safford &lt;safford@watson.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;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>KEYS: Fix bug in keyctl_session_to_parent() if parent has no session keyring</title>
<updated>2011-01-06T23:08:02Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-09-10T08:59:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=dd1644658bbefe2626a5307e90c009720bd62623'/>
<id>urn:sha1:dd1644658bbefe2626a5307e90c009720bd62623</id>
<content type='text'>
commit 3d96406c7da1ed5811ea52a3b0905f4f0e295376 upstream.

Fix a bug in keyctl_session_to_parent() whereby it tries to check the ownership
of the parent process's session keyring whether or not the parent has a session
keyring [CVE-2010-2960].

This results in the following oops:

  BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0
  IP: [&lt;ffffffff811ae4dd&gt;] keyctl_session_to_parent+0x251/0x443
  ...
  Call Trace:
   [&lt;ffffffff811ae2f3&gt;] ? keyctl_session_to_parent+0x67/0x443
   [&lt;ffffffff8109d286&gt;] ? __do_fault+0x24b/0x3d0
   [&lt;ffffffff811af98c&gt;] sys_keyctl+0xb4/0xb8
   [&lt;ffffffff81001eab&gt;] system_call_fastpath+0x16/0x1b

if the parent process has no session keyring.

If the system is using pam_keyinit then it mostly protected against this as all
processes derived from a login will have inherited the session keyring created
by pam_keyinit during the log in procedure.

To test this, pam_keyinit calls need to be commented out in /etc/pam.d/.

Reported-by: Tavis Ormandy &lt;taviso@cmpxchg8b.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Tavis Ormandy &lt;taviso@cmpxchg8b.com&gt;
Cc: dann frazier &lt;dannf@debian.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>KEYS: Fix RCU no-lock warning in keyctl_session_to_parent()</title>
<updated>2011-01-06T23:08:02Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-09-10T08:59:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0a92e55adab5b09f9d13e5132e2678c30d34e2f9'/>
<id>urn:sha1:0a92e55adab5b09f9d13e5132e2678c30d34e2f9</id>
<content type='text'>
commit 9d1ac65a9698513d00e5608d93fca0c53f536c14 upstream.

There's an protected access to the parent process's credentials in the middle
of keyctl_session_to_parent().  This results in the following RCU warning:

  ===================================================
  [ INFO: suspicious rcu_dereference_check() usage. ]
  ---------------------------------------------------
  security/keys/keyctl.c:1291 invoked rcu_dereference_check() without protection!

  other info that might help us debug this:

  rcu_scheduler_active = 1, debug_locks = 0
  1 lock held by keyctl-session-/2137:
   #0:  (tasklist_lock){.+.+..}, at: [&lt;ffffffff811ae2ec&gt;] keyctl_session_to_parent+0x60/0x236

  stack backtrace:
  Pid: 2137, comm: keyctl-session- Not tainted 2.6.36-rc2-cachefs+ #1
  Call Trace:
   [&lt;ffffffff8105606a&gt;] lockdep_rcu_dereference+0xaa/0xb3
   [&lt;ffffffff811ae379&gt;] keyctl_session_to_parent+0xed/0x236
   [&lt;ffffffff811af77e&gt;] sys_keyctl+0xb4/0xb6
   [&lt;ffffffff81001eab&gt;] system_call_fastpath+0x16/0x1b

The code should take the RCU read lock to make sure the parents credentials
don't go away, even though it's holding a spinlock and has IRQ disabled.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>KEYS: Return more accurate error codes</title>
<updated>2011-01-06T23:07:33Z</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2010-05-17T13:42:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d7159a6d256020f249e3038577a38280ea4576cf'/>
<id>urn:sha1:d7159a6d256020f249e3038577a38280ea4576cf</id>
<content type='text'>
commit 4d09ec0f705cf88a12add029c058b53f288cfaa2 upstream.

We were using the wrong variable here so the error codes weren't being returned
properly.  The original code returns -ENOKEY.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>mmap_min_addr check CAP_SYS_RAWIO only for write</title>
<updated>2010-05-14T09:03:15Z</updated>
<author>
<name>Kees Cook</name>
<email>kees.cook@canonical.com</email>
</author>
<published>2010-04-22T19:19:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4ae69e6b718589abe97c9625ccbb1e0bc95a8c0e'/>
<id>urn:sha1:4ae69e6b718589abe97c9625ccbb1e0bc95a8c0e</id>
<content type='text'>
Redirecting directly to lsm, here's the patch discussed on lkml:
http://lkml.org/lkml/2010/4/22/219

The mmap_min_addr value is useful information for an admin to see without
being root ("is my system vulnerable to kernel NULL pointer attacks?") and
its setting is trivially easy for an attacker to determine by calling
mmap() in PAGE_SIZE increments starting at 0, so trying to keep it private
has no value.

Only require CAP_SYS_RAWIO if changing the value, not reading it.

Comment from Serge :

  Me, I like to write my passwords with light blue pen on dark blue
  paper, pasted on my window - if you're going to get my password, you're
  gonna get a headache.

Signed-off-by: Kees Cook &lt;kees.cook@canonical.com&gt;
Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
(cherry picked from commit 822cceec7248013821d655545ea45d1c6a9d15b3)
</content>
</entry>
<entry>
<title>KEYS: call_sbin_request_key() must write lock keyrings before modifying them</title>
<updated>2010-05-05T13:50:24Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-04-30T13:32:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=896903c2f5f79f029388f033a00c3b813bc91201'/>
<id>urn:sha1:896903c2f5f79f029388f033a00c3b813bc91201</id>
<content type='text'>
call_sbin_request_key() creates a keyring and then attempts to insert a link to
the authorisation key into that keyring, but does so without holding a write
lock on the keyring semaphore.

It will normally get away with this because it hasn't told anyone that the
keyring exists yet.  The new keyring, however, has had its serial number
published, which means it can be accessed directly by that handle.

This was found by a previous patch that adds RCU lockdep checks to the code
that reads the keyring payload pointer, which includes a check that the keyring
semaphore is actually locked.

Without this patch, the following command:

	keyctl request2 user b a @s

will provoke the following lockdep warning is displayed in dmesg:

	===================================================
	[ INFO: suspicious rcu_dereference_check() usage. ]
	---------------------------------------------------
	security/keys/keyring.c:727 invoked rcu_dereference_check() without protection!

	other info that might help us debug this:

	rcu_scheduler_active = 1, debug_locks = 0
	2 locks held by keyctl/2076:
	 #0:  (key_types_sem){.+.+.+}, at: [&lt;ffffffff811a5b29&gt;] key_type_lookup+0x1c/0x71
	 #1:  (keyring_serialise_link_sem){+.+.+.}, at: [&lt;ffffffff811a6d1e&gt;] __key_link+0x4d/0x3c5

	stack backtrace:
	Pid: 2076, comm: keyctl Not tainted 2.6.34-rc6-cachefs #54
	Call Trace:
	 [&lt;ffffffff81051fdc&gt;] lockdep_rcu_dereference+0xaa/0xb2
	 [&lt;ffffffff811a6d1e&gt;] ? __key_link+0x4d/0x3c5
	 [&lt;ffffffff811a6e6f&gt;] __key_link+0x19e/0x3c5
	 [&lt;ffffffff811a5952&gt;] ? __key_instantiate_and_link+0xb1/0xdc
	 [&lt;ffffffff811a59bf&gt;] ? key_instantiate_and_link+0x42/0x5f
	 [&lt;ffffffff811aa0dc&gt;] call_sbin_request_key+0xe7/0x33b
	 [&lt;ffffffff8139376a&gt;] ? mutex_unlock+0x9/0xb
	 [&lt;ffffffff811a5952&gt;] ? __key_instantiate_and_link+0xb1/0xdc
	 [&lt;ffffffff811a59bf&gt;] ? key_instantiate_and_link+0x42/0x5f
	 [&lt;ffffffff811aa6fa&gt;] ? request_key_auth_new+0x1c2/0x23c
	 [&lt;ffffffff810aaf15&gt;] ? cache_alloc_debugcheck_after+0x108/0x173
	 [&lt;ffffffff811a9d00&gt;] ? request_key_and_link+0x146/0x300
	 [&lt;ffffffff810ac568&gt;] ? kmem_cache_alloc+0xe1/0x118
	 [&lt;ffffffff811a9e45&gt;] request_key_and_link+0x28b/0x300
	 [&lt;ffffffff811a89ac&gt;] sys_request_key+0xf7/0x14a
	 [&lt;ffffffff81052c0b&gt;] ? trace_hardirqs_on_caller+0x10c/0x130
	 [&lt;ffffffff81394fb9&gt;] ? trace_hardirqs_on_thunk+0x3a/0x3f
	 [&lt;ffffffff81001eeb&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>KEYS: Use RCU dereference wrappers in keyring key type code</title>
<updated>2010-05-05T13:50:12Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-04-30T13:32:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f0641cba7729e5e14f82d2eedc398103f5fa31b1'/>
<id>urn:sha1:f0641cba7729e5e14f82d2eedc398103f5fa31b1</id>
<content type='text'>
The keyring key type code should use RCU dereference wrappers, even when it
holds the keyring's key semaphore.

Reported-by: Vegard Nossum &lt;vegard.nossum@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
</feed>
