Skip to content

Commit

Permalink
Merge tag 'yama-4.0' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/kees/linux into next
  • Loading branch information
James Morris committed Mar 3, 2015
2 parents c517d83 + 44aa1d4 commit 74f0414
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 0 additions & 2 deletions security/yama/Kconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
config SECURITY_YAMA
bool "Yama support"
depends on SECURITY
select SECURITYFS
select SECURITY_PATH
default n
help
This selects Yama, which extends DAC support with additional
Expand Down
13 changes: 5 additions & 8 deletions security/yama/yama_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,20 +379,17 @@ static struct security_operations yama_ops = {
static int yama_dointvec_minmax(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
{
int rc;
struct ctl_table table_copy;

if (write && !capable(CAP_SYS_PTRACE))
return -EPERM;

rc = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
if (rc)
return rc;

/* Lock the max value if it ever gets set. */
if (write && *(int *)table->data == *(int *)table->extra2)
table->extra1 = table->extra2;
table_copy = *table;
if (*(int *)table_copy.data == *(int *)table_copy.extra2)
table_copy.extra1 = table_copy.extra2;

return rc;
return proc_dointvec_minmax(&table_copy, write, buffer, lenp, ppos);
}

static int zero;
Expand Down

0 comments on commit 74f0414

Please sign in to comment.