lkml.org 
[lkml]   [2016]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC][PATCH 2/2 v2] security: Add task_settimerslack LSM hook
On Fri, Jul 15, 2016 at 10:51 AM, Nick Kralevich <nnk@google.com> wrote:
> On Fri, Jul 15, 2016 at 10:24 AM, John Stultz <john.stultz@linaro.org> wrote:
>> As requested, this patch implements a task_settimerslack LSM hook
>> so that the /proc/<tid>/timerslack_ns interface can have finer
>> grained security policies applied to it.
>>
>> Don't really know what I'm doing here, so close review would be
>> appreciated!
>>
>> Cc: Kees Cook <keescook@chromium.org>
>> Cc: "Serge E. Hallyn" <serge@hallyn.com>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> CC: Arjan van de Ven <arjan@linux.intel.com>
>> Cc: Oren Laadan <orenl@cellrox.com>
>> Cc: Ruchi Kandoi <kandoiruchi@google.com>
>> Cc: Rom Lemarchand <romlem@android.com>
>> Cc: Todd Kjos <tkjos@google.com>
>> Cc: Colin Cross <ccross@android.com>
>> Cc: Nick Kralevich <nnk@google.com>
>> Cc: Dmitry Shmidt <dimitrysh@google.com>
>> Cc: Elliott Hughes <enh@google.com>
>> Cc: Android Kernel Team <kernel-team@android.com>
>> Signed-off-by: John Stultz <john.stultz@linaro.org>
>> ---
>> v2: Initial swing at adding LSM hook
>>
>> fs/proc/base.c | 7 +++++++
>> include/linux/lsm_hooks.h | 7 +++++++
>> include/linux/security.h | 6 ++++++
>> security/security.c | 7 +++++++
>> security/selinux/hooks.c | 6 ++++++
>> 5 files changed, 33 insertions(+)
>>
>> diff --git a/fs/proc/base.c b/fs/proc/base.c
>> index 8f4f8d7..7f10b37 100644
>> --- a/fs/proc/base.c
>> +++ b/fs/proc/base.c
>> @@ -2284,6 +2284,12 @@ static ssize_t timerslack_ns_write(struct file *file, const char __user *buf,
>> if (!p)
>> return -ESRCH;
>>
>> + err = security_task_settimerslack(current, slack_ns);
>
> The first argument should be "p", not "current". "p" is the target
> process you're trying to adjust.

Ah, yes. Thanks. Clearly I don't know what I'm doing here. :)
-john

\
 
 \ /
  Last update: 2016-07-15 21:01    [W:0.042 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site