Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1444496

Re: [RFC][PATCH 2/2 v2] security: Add task_settimerslack LSM hook

From John Stultz <john.stultz@linaro.org>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH 2/2 v2] security: Add task_settimerslack LSM hook
Date 2016-07-15 20:20 +0200
Message-ID <rVfSp-1LH-5@gated-at.bofh.it> (permalink)
References <rVf62-1fR-27@gated-at.bofh.it> <rVf62-1fR-25@gated-at.bofh.it> <rVfz4-1pW-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC][PATCH 2/2 v2] security: Add task_settimerslack LSM hook John Stultz <john.stultz@linaro.org> - 2016-07-15 19:30 +0200
  Re: [RFC][PATCH 2/2 v2] security: Add task_settimerslack LSM hook Nick Kralevich <nnk@google.com> - 2016-07-15 20:00 +0200
    Re: [RFC][PATCH 2/2 v2] security: Add task_settimerslack LSM hook John Stultz <john.stultz@linaro.org> - 2016-07-15 20:20 +0200

csiph-web