Skip to content

Commit

Permalink
keys: skip keys from another user namespace
Browse files Browse the repository at this point in the history
When listing keys, do not return keys belonging to the
same uid in another user namespace.  Otherwise uid 500
in another user namespace will return keyrings called
uid.500 for another user namespace.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
Serge E. Hallyn authored and James Morris committed Feb 27, 2009
1 parent 8ff3bc3 commit 2ea190d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions security/keys/keyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check)
&keyring_name_hash[bucket],
type_data.link
) {
if (keyring->user->user_ns != current_user_ns())
continue;

if (test_bit(KEY_FLAG_REVOKED, &keyring->flags))
continue;

Expand Down

0 comments on commit 2ea190d

Please sign in to comment.