/openbmc/linux/include/uapi/linux/ |
H A D | keyctl.h | diff b206f281d0ee14969878469816a69db22d5838e8 Wed Jun 26 15:02:32 CDT 2019 David Howells <dhowells@redhat.com> keys: Namespace keyring names
Keyring names are held in a single global list that any process can pick from by means of keyctl_join_session_keyring (provided the keyring grants Search permission). This isn't very container friendly, however.
Make the following changes:
(1) Make default session, process and thread keyring names begin with a '.' instead of '_'.
(2) Keyrings whose names begin with a '.' aren't added to the list. Such keyrings are system specials.
(3) Replace the global list with per-user_namespace lists. A keyring adds its name to the list for the user_namespace that it is currently in.
(4) When a user_namespace is deleted, it just removes itself from the keyring name list.
The global keyring_name_lock is retained for accessing the name lists. This allows (4) to work.
This can be tested by:
# keyctl newring foo @s 995906392 # unshare -U $ keyctl show ... 995906392 --alswrv 65534 65534 \_ keyring: foo ... $ keyctl session foo Joined session keyring: 935622349
As can be seen, a new session keyring was created.
The capability bit KEYCTL_CAPS1_NS_KEYRING_NAME is set if the kernel is employing this feature.
Signed-off-by: David Howells <dhowells@redhat.com> cc: Eric W. Biederman <ebiederm@xmission.com>
|
/openbmc/linux/include/linux/ |
H A D | user_namespace.h | diff b206f281d0ee14969878469816a69db22d5838e8 Wed Jun 26 15:02:32 CDT 2019 David Howells <dhowells@redhat.com> keys: Namespace keyring names
Keyring names are held in a single global list that any process can pick from by means of keyctl_join_session_keyring (provided the keyring grants Search permission). This isn't very container friendly, however.
Make the following changes:
(1) Make default session, process and thread keyring names begin with a '.' instead of '_'.
(2) Keyrings whose names begin with a '.' aren't added to the list. Such keyrings are system specials.
(3) Replace the global list with per-user_namespace lists. A keyring adds its name to the list for the user_namespace that it is currently in.
(4) When a user_namespace is deleted, it just removes itself from the keyring name list.
The global keyring_name_lock is retained for accessing the name lists. This allows (4) to work.
This can be tested by:
# keyctl newring foo @s 995906392 # unshare -U $ keyctl show ... 995906392 --alswrv 65534 65534 \_ keyring: foo ... $ keyctl session foo Joined session keyring: 935622349
As can be seen, a new session keyring was created.
The capability bit KEYCTL_CAPS1_NS_KEYRING_NAME is set if the kernel is employing this feature.
Signed-off-by: David Howells <dhowells@redhat.com> cc: Eric W. Biederman <ebiederm@xmission.com>
|
H A D | key.h | diff b206f281d0ee14969878469816a69db22d5838e8 Wed Jun 26 15:02:32 CDT 2019 David Howells <dhowells@redhat.com> keys: Namespace keyring names
Keyring names are held in a single global list that any process can pick from by means of keyctl_join_session_keyring (provided the keyring grants Search permission). This isn't very container friendly, however.
Make the following changes:
(1) Make default session, process and thread keyring names begin with a '.' instead of '_'.
(2) Keyrings whose names begin with a '.' aren't added to the list. Such keyrings are system specials.
(3) Replace the global list with per-user_namespace lists. A keyring adds its name to the list for the user_namespace that it is currently in.
(4) When a user_namespace is deleted, it just removes itself from the keyring name list.
The global keyring_name_lock is retained for accessing the name lists. This allows (4) to work.
This can be tested by:
# keyctl newring foo @s 995906392 # unshare -U $ keyctl show ... 995906392 --alswrv 65534 65534 \_ keyring: foo ... $ keyctl session foo Joined session keyring: 935622349
As can be seen, a new session keyring was created.
The capability bit KEYCTL_CAPS1_NS_KEYRING_NAME is set if the kernel is employing this feature.
Signed-off-by: David Howells <dhowells@redhat.com> cc: Eric W. Biederman <ebiederm@xmission.com>
|
/openbmc/linux/kernel/ |
H A D | user.c | diff b206f281d0ee14969878469816a69db22d5838e8 Wed Jun 26 15:02:32 CDT 2019 David Howells <dhowells@redhat.com> keys: Namespace keyring names
Keyring names are held in a single global list that any process can pick from by means of keyctl_join_session_keyring (provided the keyring grants Search permission). This isn't very container friendly, however.
Make the following changes:
(1) Make default session, process and thread keyring names begin with a '.' instead of '_'.
(2) Keyrings whose names begin with a '.' aren't added to the list. Such keyrings are system specials.
(3) Replace the global list with per-user_namespace lists. A keyring adds its name to the list for the user_namespace that it is currently in.
(4) When a user_namespace is deleted, it just removes itself from the keyring name list.
The global keyring_name_lock is retained for accessing the name lists. This allows (4) to work.
This can be tested by:
# keyctl newring foo @s 995906392 # unshare -U $ keyctl show ... 995906392 --alswrv 65534 65534 \_ keyring: foo ... $ keyctl session foo Joined session keyring: 935622349
As can be seen, a new session keyring was created.
The capability bit KEYCTL_CAPS1_NS_KEYRING_NAME is set if the kernel is employing this feature.
Signed-off-by: David Howells <dhowells@redhat.com> cc: Eric W. Biederman <ebiederm@xmission.com>
|
H A D | user_namespace.c | diff b206f281d0ee14969878469816a69db22d5838e8 Wed Jun 26 15:02:32 CDT 2019 David Howells <dhowells@redhat.com> keys: Namespace keyring names
Keyring names are held in a single global list that any process can pick from by means of keyctl_join_session_keyring (provided the keyring grants Search permission). This isn't very container friendly, however.
Make the following changes:
(1) Make default session, process and thread keyring names begin with a '.' instead of '_'.
(2) Keyrings whose names begin with a '.' aren't added to the list. Such keyrings are system specials.
(3) Replace the global list with per-user_namespace lists. A keyring adds its name to the list for the user_namespace that it is currently in.
(4) When a user_namespace is deleted, it just removes itself from the keyring name list.
The global keyring_name_lock is retained for accessing the name lists. This allows (4) to work.
This can be tested by:
# keyctl newring foo @s 995906392 # unshare -U $ keyctl show ... 995906392 --alswrv 65534 65534 \_ keyring: foo ... $ keyctl session foo Joined session keyring: 935622349
As can be seen, a new session keyring was created.
The capability bit KEYCTL_CAPS1_NS_KEYRING_NAME is set if the kernel is employing this feature.
Signed-off-by: David Howells <dhowells@redhat.com> cc: Eric W. Biederman <ebiederm@xmission.com>
|
/openbmc/linux/security/keys/ |
H A D | keyring.c | diff b206f281d0ee14969878469816a69db22d5838e8 Wed Jun 26 15:02:32 CDT 2019 David Howells <dhowells@redhat.com> keys: Namespace keyring names
Keyring names are held in a single global list that any process can pick from by means of keyctl_join_session_keyring (provided the keyring grants Search permission). This isn't very container friendly, however.
Make the following changes:
(1) Make default session, process and thread keyring names begin with a '.' instead of '_'.
(2) Keyrings whose names begin with a '.' aren't added to the list. Such keyrings are system specials.
(3) Replace the global list with per-user_namespace lists. A keyring adds its name to the list for the user_namespace that it is currently in.
(4) When a user_namespace is deleted, it just removes itself from the keyring name list.
The global keyring_name_lock is retained for accessing the name lists. This allows (4) to work.
This can be tested by:
# keyctl newring foo @s 995906392 # unshare -U $ keyctl show ... 995906392 --alswrv 65534 65534 \_ keyring: foo ... $ keyctl session foo Joined session keyring: 935622349
As can be seen, a new session keyring was created.
The capability bit KEYCTL_CAPS1_NS_KEYRING_NAME is set if the kernel is employing this feature.
Signed-off-by: David Howells <dhowells@redhat.com> cc: Eric W. Biederman <ebiederm@xmission.com>
|
H A D | keyctl.c | diff b206f281d0ee14969878469816a69db22d5838e8 Wed Jun 26 15:02:32 CDT 2019 David Howells <dhowells@redhat.com> keys: Namespace keyring names
Keyring names are held in a single global list that any process can pick from by means of keyctl_join_session_keyring (provided the keyring grants Search permission). This isn't very container friendly, however.
Make the following changes:
(1) Make default session, process and thread keyring names begin with a '.' instead of '_'.
(2) Keyrings whose names begin with a '.' aren't added to the list. Such keyrings are system specials.
(3) Replace the global list with per-user_namespace lists. A keyring adds its name to the list for the user_namespace that it is currently in.
(4) When a user_namespace is deleted, it just removes itself from the keyring name list.
The global keyring_name_lock is retained for accessing the name lists. This allows (4) to work.
This can be tested by:
# keyctl newring foo @s 995906392 # unshare -U $ keyctl show ... 995906392 --alswrv 65534 65534 \_ keyring: foo ... $ keyctl session foo Joined session keyring: 935622349
As can be seen, a new session keyring was created.
The capability bit KEYCTL_CAPS1_NS_KEYRING_NAME is set if the kernel is employing this feature.
Signed-off-by: David Howells <dhowells@redhat.com> cc: Eric W. Biederman <ebiederm@xmission.com>
|