diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-15 13:25:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-15 13:25:26 -0400 |
commit | 92d4a03674b8c399c2f547580fa509db78226170 (patch) | |
tree | e5492e0214e31a10a79dbad6135a047f37721fc9 /security/security.c | |
parent | 1eb46908b35dfbac0ec1848d4b1e39667e0187e9 (diff) | |
parent | 87ea58433208d17295e200d56be5e2a4fe4ce7d6 (diff) |
Merge branch 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security subsystem updates from James Morris:
- kstrdup() return value fix from Eric Biggers
- Add new security_load_data hook to differentiate security checking of
kernel-loaded binaries in the case of there being no associated file
descriptor, from Mimi Zohar.
- Add ability to IMA to specify a policy at build-time, rather than
just via command line params or by loading a custom policy, from
Mimi.
- Allow IMA and LSMs to prevent sysfs firmware load fallback (e.g. if
using signed firmware), from Mimi.
- Allow IMA to deny loading of kexec kernel images, as they cannot be
measured by IMA, from Mimi.
* 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
security: check for kstrdup() failure in lsm_append()
security: export security_kernel_load_data function
ima: based on policy warn about loading firmware (pre-allocated buffer)
module: replace the existing LSM hook in init_module
ima: add build time policy
ima: based on policy require signed firmware (sysfs fallback)
firmware: add call to LSM hook before firmware sysfs fallback
ima: based on policy require signed kexec kernel images
kexec: add call to LSM hook in original kexec_load syscall
security: define new LSM hook named security_kernel_load_data
MAINTAINERS: remove the outdated "LINUX SECURITY MODULE (LSM) FRAMEWORK" entry
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/security/security.c b/security/security.c index 5dce67070cdf..ab4f96347ebb 100644 --- a/security/security.c +++ b/security/security.c | |||
@@ -118,6 +118,8 @@ static int lsm_append(char *new, char **result) | |||
118 | 118 | ||
119 | if (*result == NULL) { | 119 | if (*result == NULL) { |
120 | *result = kstrdup(new, GFP_KERNEL); | 120 | *result = kstrdup(new, GFP_KERNEL); |
121 | if (*result == NULL) | ||
122 | return -ENOMEM; | ||
121 | } else { | 123 | } else { |
122 | /* Check if it is the last registered name */ | 124 | /* Check if it is the last registered name */ |
123 | if (match_last_lsm(*result, new)) | 125 | if (match_last_lsm(*result, new)) |
@@ -1056,6 +1058,17 @@ int security_kernel_post_read_file(struct file *file, char *buf, loff_t size, | |||
1056 | } | 1058 | } |
1057 | EXPORT_SYMBOL_GPL(security_kernel_post_read_file); | 1059 | EXPORT_SYMBOL_GPL(security_kernel_post_read_file); |
1058 | 1060 | ||
1061 | int security_kernel_load_data(enum kernel_load_data_id id) | ||
1062 | { | ||
1063 | int ret; | ||
1064 | |||
1065 | ret = call_int_hook(kernel_load_data, 0, id); | ||
1066 | if (ret) | ||
1067 | return ret; | ||
1068 | return ima_load_data(id); | ||
1069 | } | ||
1070 | EXPORT_SYMBOL_GPL(security_kernel_load_data); | ||
1071 | |||
1059 | int security_task_fix_setuid(struct cred *new, const struct cred *old, | 1072 | int security_task_fix_setuid(struct cred *new, const struct cred *old, |
1060 | int flags) | 1073 | int flags) |
1061 | { | 1074 | { |