<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/security/keys, branch v2.6.36.4</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>KEYS: Don't call up_write() if __key_link_begin() returns an error</title>
<updated>2011-02-17T22:47:26+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-12-22T16:24:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=de79143f1a7d8bc3340d982813ccc013cca01ccc'/>
<id>de79143f1a7d8bc3340d982813ccc013cca01ccc</id>
<content type='text'>
commit 3fc5e98d8cf85e0d77fc597b49e9268dff67400e upstream.

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;
Cc: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

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

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;
Cc: James Morris &lt;jmorris@namei.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>KEYS: Fix bug in keyctl_session_to_parent() if parent has no session keyring</title>
<updated>2010-09-10T14:30:00+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-09-10T08:59:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3d96406c7da1ed5811ea52a3b0905f4f0e295376'/>
<id>3d96406c7da1ed5811ea52a3b0905f4f0e295376</id>
<content type='text'>
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;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KEYS: Fix RCU no-lock warning in keyctl_session_to_parent()</title>
<updated>2010-09-10T14:30:00+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-09-10T08:59:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9d1ac65a9698513d00e5608d93fca0c53f536c14'/>
<id>9d1ac65a9698513d00e5608d93fca0c53f536c14</id>
<content type='text'>
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;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a dummy printk function for the maintenance of unused printks</title>
<updated>2010-08-12T16:51:35+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-08-12T15:54:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=12fdff3fc2483f906ae6404a6e8dcf2550310b6f'/>
<id>12fdff3fc2483f906ae6404a6e8dcf2550310b6f</id>
<content type='text'>
Add a dummy printk function for the maintenance of unused printks through gcc
format checking, and also so that side-effect checking is maintained too.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a dummy printk function for the maintenance of unused printks through gcc
format checking, and also so that side-effect checking is maintained too.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KEYS: request_key() should return -ENOKEY if the constructed key is negative</title>
<updated>2010-08-06T16:17:02+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-08-06T15:08:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1e456a124353a753e9d1fadfbf5cd459c2f197ae'/>
<id>1e456a124353a753e9d1fadfbf5cd459c2f197ae</id>
<content type='text'>
request_key() should return -ENOKEY if the key it constructs has been
negatively instantiated.

Without this, request_key() can return an unusable key to its caller,
and if the caller then does key_validate() that won't catch the problem.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
request_key() should return -ENOKEY if the key it constructs has been
negatively instantiated.

Without this, request_key() can return an unusable key to its caller,
and if the caller then does key_validate() that won't catch the problem.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KEYS: Reinstate lost passing of process keyring ID in call_sbin_request_key()</title>
<updated>2010-08-02T05:34:56+00:00</updated>
<author>
<name>Justin P. Mattock</name>
<email>justinmattock@gmail.com</email>
</author>
<published>2010-06-30T09:39:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5ad18a0d59ba9e65b3c8b2b489fd23bc6b3daf94'/>
<id>5ad18a0d59ba9e65b3c8b2b489fd23bc6b3daf94</id>
<content type='text'>
In commit bb952bb98a7e479262c7eb25d5592545a3af147d there was the accidental
deletion of a statement from call_sbin_request_key() to render the process
keyring ID to a text string so that it can be passed to /sbin/request-key.

With gcc 4.6.0 this causes the following warning:

  CC      security/keys/request_key.o
security/keys/request_key.c: In function 'call_sbin_request_key':
security/keys/request_key.c:102:15: warning: variable 'prkey' set but not used

This patch reinstates that statement.

Without this statement, /sbin/request-key will get some random rubbish from the
stack as that parameter.

Signed-off-by: Justin P. Mattock &lt;justinmattock@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In commit bb952bb98a7e479262c7eb25d5592545a3af147d there was the accidental
deletion of a statement from call_sbin_request_key() to render the process
keyring ID to a text string so that it can be passed to /sbin/request-key.

With gcc 4.6.0 this causes the following warning:

  CC      security/keys/request_key.o
security/keys/request_key.c: In function 'call_sbin_request_key':
security/keys/request_key.c:102:15: warning: variable 'prkey' set but not used

This patch reinstates that statement.

Without this statement, /sbin/request-key will get some random rubbish from the
stack as that parameter.

Signed-off-by: Justin P. Mattock &lt;justinmattock@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KEYS: Use the variable 'key' in keyctl_describe_key()</title>
<updated>2010-08-02T05:34:56+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-06-28T13:05:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=94fd8405ea62bd2d4a40f3013e8e6935b6643235'/>
<id>94fd8405ea62bd2d4a40f3013e8e6935b6643235</id>
<content type='text'>
keyctl_describe_key() turns the key reference it gets into a usable key pointer
and assigns that to a variable called 'key', which it then ignores in favour of
recomputing the key pointer each time it needs it.  Make it use the precomputed
pointer instead.

Without this patch, gcc 4.6 reports that the variable key is set but not used:

	building with gcc 4.6 I'm getting a warning message:
	 CC      security/keys/keyctl.o
	security/keys/keyctl.c: In function 'keyctl_describe_key':
	security/keys/keyctl.c:472:14: warning: variable 'key' set but not used

Reported-by: Justin P. Mattock &lt;justinmattock@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
keyctl_describe_key() turns the key reference it gets into a usable key pointer
and assigns that to a variable called 'key', which it then ignores in favour of
recomputing the key pointer each time it needs it.  Make it use the precomputed
pointer instead.

Without this patch, gcc 4.6 reports that the variable key is set but not used:

	building with gcc 4.6 I'm getting a warning message:
	 CC      security/keys/keyctl.o
	security/keys/keyctl.c: In function 'keyctl_describe_key':
	security/keys/keyctl.c:472:14: warning: variable 'key' set but not used

Reported-by: Justin P. Mattock &lt;justinmattock@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KEYS: Make /proc/keys check to see if a key is possessed before security check</title>
<updated>2010-08-02T05:34:27+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-06-11T16:31:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=927942aabbbe506bf9bc70a16dc5460ecc64c148'/>
<id>927942aabbbe506bf9bc70a16dc5460ecc64c148</id>
<content type='text'>
Make /proc/keys check to see if the calling process possesses each key before
performing the security check.  The possession check can be skipped if the key
doesn't have the possessor-view permission bit set.

This causes the keys a process possesses to show up in /proc/keys, even if they
don't have matching user/group/other view permissions.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make /proc/keys check to see if the calling process possesses each key before
performing the security check.  The possession check can be skipped if the key
doesn't have the possessor-view permission bit set.

This causes the keys a process possesses to show up in /proc/keys, even if they
don't have matching user/group/other view permissions.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KEYS: Authorise keyctl_set_timeout() on a key if we have its authorisation key</title>
<updated>2010-08-02T05:34:27+00:00</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-06-11T16:31:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9156235b3427d6f01c5c95022f72f381f07583f5'/>
<id>9156235b3427d6f01c5c95022f72f381f07583f5</id>
<content type='text'>
Authorise a process to perform keyctl_set_timeout() on an uninstantiated key if
that process has the authorisation key for it.

This allows the instantiator to set the timeout on a key it is instantiating -
provided it does it before instantiating the key.

For instance, the test upcall script provided with the keyutils package could
be modified to set the expiry to an hour hence before instantiating the key:

	[/usr/share/keyutils/request-key-debug.sh]
	 if [ "$3" != "neg" ]
	 then
	+    keyctl timeout $1 3600
	     keyctl instantiate $1 "Debug $3" $4 || exit 1
	 else

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Authorise a process to perform keyctl_set_timeout() on an uninstantiated key if
that process has the authorisation key for it.

This allows the instantiator to set the timeout on a key it is instantiating -
provided it does it before instantiating the key.

For instance, the test upcall script provided with the keyutils package could
be modified to set the expiry to an hour hence before instantiating the key:

	[/usr/share/keyutils/request-key-debug.sh]
	 if [ "$3" != "neg" ]
	 then
	+    keyctl timeout $1 3600
	     keyctl instantiate $1 "Debug $3" $4 || exit 1
	 else

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: James Morris &lt;jmorris@namei.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>KEYS: Propagate error code instead of returning -EINVAL</title>
<updated>2010-06-27T14:02:34+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2010-06-11T16:30:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4303ef19c6e6d16ea845c04b02b9cf086bcb8ed7'/>
<id>4303ef19c6e6d16ea845c04b02b9cf086bcb8ed7</id>
<content type='text'>
This is from a Smatch check I'm writing.

strncpy_from_user() returns -EFAULT on error so the first change just
silences a warning but doesn't change how the code works.

The other change is a bug fix because install_thread_keyring_to_cred()
can return a variety of errors such as -EINVAL, -EEXIST, -ENOMEM or
-EKEYREVOKED.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is from a Smatch check I'm writing.

strncpy_from_user() returns -EFAULT on error so the first change just
silences a warning but doesn't change how the code works.

The other change is a bug fix because install_thread_keyring_to_cred()
can return a variety of errors such as -EINVAL, -EEXIST, -ENOMEM or
-EKEYREVOKED.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
