mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 22:12:16 +00:00
CRED: Neuter sys_capset()
Take away the ability for sys_capset() to affect processes other than current. This means that current will not need to lock its own credentials when reading them against interference by other processes. This has effectively been the case for a while anyway, since: (1) Without LSM enabled, sys_capset() is disallowed. (2) With file-based capabilities, sys_capset() is neutered. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Acked-by: Andrew G. Morgan <morgan@kernel.org> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
parent
8bbf4976b5
commit
1cdcbec1a3
6 changed files with 63 additions and 285 deletions
12
fs/open.c
12
fs/open.c
|
@ -441,17 +441,7 @@ asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode)
|
|||
current->fsgid = current->gid;
|
||||
|
||||
if (!issecure(SECURE_NO_SETUID_FIXUP)) {
|
||||
/*
|
||||
* Clear the capabilities if we switch to a non-root user
|
||||
*/
|
||||
#ifndef CONFIG_SECURITY_FILE_CAPABILITIES
|
||||
/*
|
||||
* FIXME: There is a race here against sys_capset. The
|
||||
* capabilities can change yet we will restore the old
|
||||
* value below. We should hold task_capabilities_lock,
|
||||
* but we cannot because user_path_at can sleep.
|
||||
*/
|
||||
#endif /* ndef CONFIG_SECURITY_FILE_CAPABILITIES */
|
||||
/* Clear the capabilities if we switch to a non-root user */
|
||||
if (current->uid)
|
||||
old_cap = cap_set_effective(__cap_empty_set);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue