[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20181030164027.GA184838@google.com>
Date: Tue, 30 Oct 2018 10:40:27 -0600
From: Benjamin Gordon <bmgordon@...gle.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: linux-kernel@...r.kernel.org, John Stultz <john.stultz@...aro.org>,
Kees Cook <keescook@...omium.org>,
"Serge E. Hallyn" <serge@...lyn.com>,
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>,
Nick Kralevich <nnk@...gle.com>,
Dmitry Shmidt <dimitrysh@...gle.com>,
Elliott Hughes <enh@...gle.com>,
Android Kernel Team <kernel-team@...roid.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] proc: use ns_capable instead of capable for timerslack_ns
On Thu, Oct 25, 2018 at 01:56:27PM -0500, Eric W. Biederman wrote:
> > Access to timerslack_ns is controlled by a process having CAP_SYS_NICE
> > in its effective capability set, but the current check looks in the root
> > namespace instead of the process' user namespace. Since a process is
> > allowed to do other activities controlled by CAP_SYS_NICE inside a
> > namespace, it should also be able to adjust timerslack_ns.
>
> The goal seems legitimate. However the permission checks look wrong.
>
> In particular the choice of user namespace should be
> "p->cred->user_ns". This will limit this to tasks that have
> CAP_SYS_NICE in the same namespace as the task that is being modified.
>
> Testing file->f_cred->user_ns it is testing whoever opened the file and
> that could be anyone.
Thanks, that seems like the right answer here. I'll send a v2 to fix
it.
Thanks,
Benjamin
Powered by blists - more mailing lists