<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/security, branch v2.6.37</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=v2.6.37</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.37'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2011-01-04T00:36:33Z</updated>
<entry>
<title>ima: fix add LSM rule bug</title>
<updated>2011-01-04T00:36:33Z</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.shady.money/linux/commit/?id=867c20265459d30a01b021a9c1e81fb4c5832aa9'/>
<id>urn:sha1:867c20265459d30a01b021a9c1e81fb4c5832aa9</id>
<content type='text'>
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;
Cc: &lt;stable@kernel.org&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>KEYS: Don't call up_write() if __key_link_begin() returns an error</title>
<updated>2010-12-23T23:31:48Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-12-22T16:24:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3fc5e98d8cf85e0d77fc597b49e9268dff67400e'/>
<id>urn:sha1:3fc5e98d8cf85e0d77fc597b49e9268dff67400e</id>
<content type='text'>
In construct_alloc_key(), up_write() is called in the error path if
__key_link_begin() fails, but this is incorrect as __key_link_begin() only
returns with the nominated keyring locked if it returns successfully.

Without this patch, you might see the following in dmesg:

	=====================================
	[ BUG: bad unlock balance detected! ]
	-------------------------------------
	mount.cifs/5769 is trying to release lock (&amp;key-&gt;sem) at:
	[&lt;ffffffff81201159&gt;] request_key_and_link+0x263/0x3fc
	but there are no more locks to release!

	other info that might help us debug this:
	3 locks held by mount.cifs/5769:
	 #0:  (&amp;type-&gt;s_umount_key#41/1){+.+.+.}, at: [&lt;ffffffff81131321&gt;] sget+0x278/0x3e7
	 #1:  (&amp;ret_buf-&gt;session_mutex){+.+.+.}, at: [&lt;ffffffffa0258e59&gt;] cifs_get_smb_ses+0x35a/0x443 [cifs]
	 #2:  (root_key_user.cons_lock){+.+.+.}, at: [&lt;ffffffff81201000&gt;] request_key_and_link+0x10a/0x3fc

	stack backtrace:
	Pid: 5769, comm: mount.cifs Not tainted 2.6.37-rc6+ #1
	Call Trace:
	 [&lt;ffffffff81201159&gt;] ? request_key_and_link+0x263/0x3fc
	 [&lt;ffffffff81081601&gt;] print_unlock_inbalance_bug+0xca/0xd5
	 [&lt;ffffffff81083248&gt;] lock_release_non_nested+0xc1/0x263
	 [&lt;ffffffff81201159&gt;] ? request_key_and_link+0x263/0x3fc
	 [&lt;ffffffff81201159&gt;] ? request_key_and_link+0x263/0x3fc
	 [&lt;ffffffff81083567&gt;] lock_release+0x17d/0x1a4
	 [&lt;ffffffff81073f45&gt;] up_write+0x23/0x3b
	 [&lt;ffffffff81201159&gt;] request_key_and_link+0x263/0x3fc
	 [&lt;ffffffffa026fe9e&gt;] ? cifs_get_spnego_key+0x61/0x21f [cifs]
	 [&lt;ffffffff812013c5&gt;] request_key+0x41/0x74
	 [&lt;ffffffffa027003d&gt;] cifs_get_spnego_key+0x200/0x21f [cifs]
	 [&lt;ffffffffa026e296&gt;] CIFS_SessSetup+0x55d/0x1273 [cifs]
	 [&lt;ffffffffa02589e1&gt;] cifs_setup_session+0x90/0x1ae [cifs]
	 [&lt;ffffffffa0258e7e&gt;] cifs_get_smb_ses+0x37f/0x443 [cifs]
	 [&lt;ffffffffa025a9e3&gt;] cifs_mount+0x1aa1/0x23f3 [cifs]
	 [&lt;ffffffff8111fd94&gt;] ? alloc_debug_processing+0xdb/0x120
	 [&lt;ffffffffa027002c&gt;] ? cifs_get_spnego_key+0x1ef/0x21f [cifs]
	 [&lt;ffffffffa024cc71&gt;] cifs_do_mount+0x165/0x2b3 [cifs]
	 [&lt;ffffffff81130e72&gt;] vfs_kern_mount+0xaf/0x1dc
	 [&lt;ffffffff81131007&gt;] do_kern_mount+0x4d/0xef
	 [&lt;ffffffff811483b9&gt;] do_mount+0x6f4/0x733
	 [&lt;ffffffff8114861f&gt;] sys_mount+0x88/0xc2
	 [&lt;ffffffff8100ac42&gt;] system_call_fastpath+0x16/0x1b

Reported-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Reviewed-and-Tested-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>capabilities/syslog: open code cap_syslog logic to fix build failure</title>
<updated>2010-11-15T23:40:01Z</updated>
<author>
<name>Eric Paris</name>
<email>eparis@redhat.com</email>
</author>
<published>2010-11-15T23:36:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=12b3052c3ee8f508b2c7ee4ddd63ed03423409d8'/>
<id>urn:sha1:12b3052c3ee8f508b2c7ee4ddd63ed03423409d8</id>
<content type='text'>
The addition of CONFIG_SECURITY_DMESG_RESTRICT resulted in a build
failure when CONFIG_PRINTK=n.  This is because the capabilities code
which used the new option was built even though the variable in question
didn't exist.

The patch here fixes this by moving the capabilities checks out of the
LSM and into the caller.  All (known) LSMs should have been calling the
capabilities hook already so it actually makes the code organization
better to eliminate the hook altogether.

Signed-off-by: Eric Paris &lt;eparis@redhat.com&gt;
Acked-by: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6</title>
<updated>2010-11-12T16:00:25Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-11-12T16:00:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fe7e96f66b2622d8492ee9dd7fc08b811086caca'/>
<id>urn:sha1:fe7e96f66b2622d8492ee9dd7fc08b811086caca</id>
<content type='text'>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
  APPARMOR: Fix memory leak of apparmor_init()
  APPARMOR: Fix memory leak of alloc_namespace()
</content>
</entry>
<entry>
<title>Restrict unprivileged access to kernel syslog</title>
<updated>2010-11-12T15:55:32Z</updated>
<author>
<name>Dan Rosenberg</name>
<email>drosenberg@vsecurity.com</email>
</author>
<published>2010-11-11T22:05:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eaf06b241b091357e72b76863ba16e89610d31bd'/>
<id>urn:sha1:eaf06b241b091357e72b76863ba16e89610d31bd</id>
<content type='text'>
The kernel syslog contains debugging information that is often useful
during exploitation of other vulnerabilities, such as kernel heap
addresses.  Rather than futilely attempt to sanitize hundreds (or
thousands) of printk statements and simultaneously cripple useful
debugging functionality, it is far simpler to create an option that
prevents unprivileged users from reading the syslog.

This patch, loosely based on grsecurity's GRKERNSEC_DMESG, creates the
dmesg_restrict sysctl.  When set to "0", the default, no restrictions are
enforced.  When set to "1", only users with CAP_SYS_ADMIN can read the
kernel syslog via dmesg(8) or other mechanisms.

[akpm@linux-foundation.org: explain the config option in kernel.txt]
Signed-off-by: Dan Rosenberg &lt;drosenberg@vsecurity.com&gt;
Acked-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Acked-by: Eugene Teo &lt;eugeneteo@kernel.org&gt;
Acked-by: Kees Cook &lt;kees.cook@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 memory leak of apparmor_init()</title>
<updated>2010-11-10T20:36:22Z</updated>
<author>
<name>wzt.wzt@gmail.com</name>
<email>wzt.wzt@gmail.com</email>
</author>
<published>2010-11-10T08:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a26d279ea87e9fef2cf8a44b371e48e6091975a6'/>
<id>urn:sha1:a26d279ea87e9fef2cf8a44b371e48e6091975a6</id>
<content type='text'>
set_init_cxt() allocted sizeof(struct aa_task_cxt) bytes for cxt,
if register_security() failed, it will cause memory leak.

Signed-off-by: Zhitong Wang &lt;zhitong.wangzt@alibaba-inc.com&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>APPARMOR: Fix memory leak of alloc_namespace()</title>
<updated>2010-11-10T20:36:18Z</updated>
<author>
<name>wzt.wzt@gmail.com</name>
<email>wzt.wzt@gmail.com</email>
</author>
<published>2010-11-10T03:31:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=246c3fb16b08193837a8009ff15ef6908534ba71'/>
<id>urn:sha1:246c3fb16b08193837a8009ff15ef6908534ba71</id>
<content type='text'>
policy-&gt;name is a substring of policy-&gt;hname, if prefix is not NULL, it will
allocted strlen(prefix) + strlen(name) + 3 bytes to policy-&gt;hname in policy_init().
use kzfree(ns-&gt;base.name) will casue memory leak if alloc_namespace() failed.

Signed-off-by: Zhitong Wang &lt;zhitong.wangzt@alibaba-inc.com&gt;
Signed-off-by: John Johansen &lt;john.johansen@canonical.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
</entry>
<entry>
<title>convert get_sb_single() users</title>
<updated>2010-10-29T08:16:28Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2010-07-24T21:48:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fc14f2fef682df677d64a145256dbd263df2aa7b'/>
<id>urn:sha1:fc14f2fef682df677d64a145256dbd263df2aa7b</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>Fix install_process_keyring error handling</title>
<updated>2010-10-28T16:02:15Z</updated>
<author>
<name>Andi Kleen</name>
<email>ak@linux.intel.com</email>
</author>
<published>2010-10-28T12:16:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=27d6379894be4a81984da4d48002196a83939ca9'/>
<id>urn:sha1:27d6379894be4a81984da4d48002196a83939ca9</id>
<content type='text'>
Fix an incorrect error check that returns 1 for error instead of the
expected error code.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6</title>
<updated>2010-10-27T00:58:44Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-10-27T00:58:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=426e1f5cec4821945642230218876b0e89aafab1'/>
<id>urn:sha1:426e1f5cec4821945642230218876b0e89aafab1</id>
<content type='text'>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (52 commits)
  split invalidate_inodes()
  fs: skip I_FREEING inodes in writeback_sb_inodes
  fs: fold invalidate_list into invalidate_inodes
  fs: do not drop inode_lock in dispose_list
  fs: inode split IO and LRU lists
  fs: switch bdev inode bdi's correctly
  fs: fix buffer invalidation in invalidate_list
  fsnotify: use dget_parent
  smbfs: use dget_parent
  exportfs: use dget_parent
  fs: use RCU read side protection in d_validate
  fs: clean up dentry lru modification
  fs: split __shrink_dcache_sb
  fs: improve DCACHE_REFERENCED usage
  fs: use percpu counter for nr_dentry and nr_dentry_unused
  fs: simplify __d_free
  fs: take dcache_lock inside __d_path
  fs: do not assign default i_ino in new_inode
  fs: introduce a per-cpu last_ino allocator
  new helper: ihold()
  ...
</content>
</entry>
</feed>
