diff options
author | James Morris <james.l.morris@oracle.com> | 2015-03-03 03:56:08 -0500 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2015-03-03 03:56:08 -0500 |
commit | 74f0414b2f9a6b12df208a69baa21e22178a2463 (patch) | |
tree | ebcd6985ad3267b926d45a672470f89a2104f13c /security | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) | |
parent | 44aa1d4413876cca0962debc9483ba009d71737f (diff) |
Merge tag 'yama-4.0' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into next
Diffstat (limited to 'security')
-rw-r--r-- | security/yama/Kconfig | 2 | ||||
-rw-r--r-- | security/yama/yama_lsm.c | 13 |
2 files changed, 5 insertions, 10 deletions
diff --git a/security/yama/Kconfig b/security/yama/Kconfig index 20ef5143c0c0..3123e1da2fed 100644 --- a/security/yama/Kconfig +++ b/security/yama/Kconfig | |||
@@ -1,8 +1,6 @@ | |||
1 | config SECURITY_YAMA | 1 | config SECURITY_YAMA |
2 | bool "Yama support" | 2 | bool "Yama support" |
3 | depends on SECURITY | 3 | depends on SECURITY |
4 | select SECURITYFS | ||
5 | select SECURITY_PATH | ||
6 | default n | 4 | default n |
7 | help | 5 | help |
8 | This selects Yama, which extends DAC support with additional | 6 | This selects Yama, which extends DAC support with additional |
diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c index 13c88fbcf037..24aae2ae2b30 100644 --- a/security/yama/yama_lsm.c +++ b/security/yama/yama_lsm.c | |||
@@ -379,20 +379,17 @@ static struct security_operations yama_ops = { | |||
379 | static int yama_dointvec_minmax(struct ctl_table *table, int write, | 379 | static int yama_dointvec_minmax(struct ctl_table *table, int write, |
380 | void __user *buffer, size_t *lenp, loff_t *ppos) | 380 | void __user *buffer, size_t *lenp, loff_t *ppos) |
381 | { | 381 | { |
382 | int rc; | 382 | struct ctl_table table_copy; |
383 | 383 | ||
384 | if (write && !capable(CAP_SYS_PTRACE)) | 384 | if (write && !capable(CAP_SYS_PTRACE)) |
385 | return -EPERM; | 385 | return -EPERM; |
386 | 386 | ||
387 | rc = proc_dointvec_minmax(table, write, buffer, lenp, ppos); | ||
388 | if (rc) | ||
389 | return rc; | ||
390 | |||
391 | /* Lock the max value if it ever gets set. */ | 387 | /* Lock the max value if it ever gets set. */ |
392 | if (write && *(int *)table->data == *(int *)table->extra2) | 388 | table_copy = *table; |
393 | table->extra1 = table->extra2; | 389 | if (*(int *)table_copy.data == *(int *)table_copy.extra2) |
390 | table_copy.extra1 = table_copy.extra2; | ||
394 | 391 | ||
395 | return rc; | 392 | return proc_dointvec_minmax(&table_copy, write, buffer, lenp, ppos); |
396 | } | 393 | } |
397 | 394 | ||
398 | static int zero; | 395 | static int zero; |