[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALAqxLWsjdzNeR3qB5gQhL1GHt1ukxTGzi7yjN2TDETLbyWKJw@mail.gmail.com>
Date: Fri, 15 Jul 2016 13:03:14 -0700
From: John Stultz <john.stultz@...aro.org>
To: Nick Kralevich <nnk@...gle.com>
Cc: lkml <linux-kernel@...r.kernel.org>,
Kees Cook <keescook@...omium.org>,
"Serge E. Hallyn" <serge@...lyn.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Arjan van de Ven <arjan@...ux.intel.com>,
Oren Laadan <orenl@...lrox.com>,
Ruchi Kandoi <kandoiruchi@...gle.com>,
Rom Lemarchand <romlem@...roid.com>,
Todd Kjos <tkjos@...gle.com>, Colin Cross <ccross@...roid.com>,
Dmitry Shmidt <dimitrysh@...gle.com>,
Elliott Hughes <enh@...gle.com>,
Android Kernel Team <kernel-team@...roid.com>,
LSM List <linux-security-module@...r.kernel.org>,
SELinux <selinux@...ho.nsa.gov>
Subject: Re: [RFC][PATCH 1/2 v2] proc: Relax /proc/<tid>/timerslack_ns
capability requirements
On Fri, Jul 15, 2016 at 12:55 PM, Nick Kralevich <nnk@...gle.com> wrote:
> On Fri, Jul 15, 2016 at 10:24 AM, John Stultz <john.stultz@...aro.org> wrote:
>> + if (!capable(CAP_SYS_NICE))
>> + return -EPERM;
>> +
>> p = get_proc_task(inode);
>> if (!p)
>> return -ESRCH;
>
> The capable(CAP_SYS_NICE) permission check should be moved to this
> point, since it doesn't make sense to return EPERM if the task
> structure doesn't exist.
Ok. Will move it.
>> @@ -2300,22 +2300,21 @@ static int timerslack_ns_show(struct seq_file *m, void *v)
>> {
>> struct inode *inode = m->private;
>> struct task_struct *p;
>> - int err = 0;
>> +
>> + if (!capable(CAP_SYS_NICE))
>> + return -EPERM;
>
> This should also have a similar LSM check for reads. For the SELinux
> implementation, this can map to the PROCESS__GETSCHED permission.
Ok. I'll wire that in as well.
Would adding both selinux_task_get and set methods in the same patch
be ok? Or would folks prefer they be split into two?
Thanks for the feedback!
-john
Powered by blists - more mailing lists