Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
633706a2
Commit
633706a2
authored
Jul 22, 2014
by
David Howells
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'keys-fixes' into keys-next
Signed-off-by:
David Howells
<
dhowells@redhat.com
>
parents
64724cfc
0d1f64f6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
3 deletions
+20
-3
crypto/asymmetric_keys/Kconfig
crypto/asymmetric_keys/Kconfig
+0
-1
fs/nfs/idmap.c
fs/nfs/idmap.c
+2
-0
include/linux/key.h
include/linux/key.h
+1
-0
lib/Kconfig
lib/Kconfig
+2
-1
net/dns_resolver/dns_query.c
net/dns_resolver/dns_query.c
+1
-0
security/keys/keyctl.c
security/keys/keyctl.c
+14
-1
No files found.
crypto/asymmetric_keys/Kconfig
View file @
633706a2
...
...
@@ -22,7 +22,6 @@ config ASYMMETRIC_PUBLIC_KEY_SUBTYPE
config PUBLIC_KEY_ALGO_RSA
tristate "RSA public-key algorithm"
select MPILIB_EXTRA
select MPILIB
help
This option enables support for the RSA algorithm (PKCS#1, RFC3447).
...
...
fs/nfs/idmap.c
View file @
633706a2
...
...
@@ -284,6 +284,8 @@ static struct key *nfs_idmap_request_key(const char *name, size_t namelen,
desc
,
""
,
0
,
idmap
);
mutex_unlock
(
&
idmap
->
idmap_mutex
);
}
if
(
!
IS_ERR
(
rkey
))
set_bit
(
KEY_FLAG_ROOT_CAN_INVAL
,
&
rkey
->
flags
);
kfree
(
desc
);
return
rkey
;
...
...
include/linux/key.h
View file @
633706a2
...
...
@@ -171,6 +171,7 @@ struct key {
#define KEY_FLAG_TRUSTED 8
/* set if key is trusted */
#define KEY_FLAG_TRUSTED_ONLY 9
/* set if keyring only accepts links to trusted keys */
#define KEY_FLAG_BUILTIN 10
/* set if key is builtin */
#define KEY_FLAG_ROOT_CAN_INVAL 11
/* set if key can be invalidated by root without permission */
/* the key type and key description string
* - the desc is used to match a key against search criteria
...
...
lib/Kconfig
View file @
633706a2
...
...
@@ -451,7 +451,8 @@ config MPILIB
config SIGNATURE
tristate
depends on KEYS && CRYPTO
depends on KEYS
select CRYPTO
select CRYPTO_SHA1
select MPILIB
help
...
...
net/dns_resolver/dns_query.c
View file @
633706a2
...
...
@@ -129,6 +129,7 @@ int dns_query(const char *type, const char *name, size_t namelen,
}
down_read
(
&
rkey
->
sem
);
set_bit
(
KEY_FLAG_ROOT_CAN_INVAL
,
&
rkey
->
flags
);
rkey
->
perm
|=
KEY_USR_VIEW
;
ret
=
key_validate
(
rkey
);
...
...
security/keys/keyctl.c
View file @
633706a2
...
...
@@ -406,12 +406,25 @@ long keyctl_invalidate_key(key_serial_t id)
key_ref
=
lookup_user_key
(
id
,
0
,
KEY_NEED_SEARCH
);
if
(
IS_ERR
(
key_ref
))
{
ret
=
PTR_ERR
(
key_ref
);
/* Root is permitted to invalidate certain special keys */
if
(
capable
(
CAP_SYS_ADMIN
))
{
key_ref
=
lookup_user_key
(
id
,
0
,
0
);
if
(
IS_ERR
(
key_ref
))
goto
error
;
if
(
test_bit
(
KEY_FLAG_ROOT_CAN_INVAL
,
&
key_ref_to_ptr
(
key_ref
)
->
flags
))
goto
invalidate
;
goto
error_put
;
}
goto
error
;
}
invalidate:
key_invalidate
(
key_ref_to_ptr
(
key_ref
));
ret
=
0
;
error_put:
key_ref_put
(
key_ref
);
error:
kleave
(
" = %ld"
,
ret
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment