[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0708070640160.31104@us.intercode.com.au>
Date: Tue, 7 Aug 2007 06:47:16 -0700 (PDT)
From: James Morris <jmorris@...ei.org>
To: "Serge E. Hallyn" <serue@...ibm.com>
cc: Andrew Morgan <morgan@...nel.org>,
Chris Wright <chrisw@...s-sol.org>,
Andrew Morgan <agm@...gle.com>, casey@...aufler-ca.com,
Andrew Morton <akpm@...gle.com>,
Stephen Smalley <sds@...ho.nsa.gov>,
KaiGai Kohei <kaigai@...gai.gr.jp>,
linux-security-module@...r.kernel.org,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/1] file capabilities: clear fcaps on inode change (v2)
On Mon, 6 Aug 2007, Serge E. Hallyn wrote:
> + err = security_inode_killpriv(out->f_path.dentry, LSM_NEED_LOCK);
> + if (err)
> + return err;
> +
> err = should_remove_suid(out->f_path.dentry);
> if (unlikely(err)) {
> mutex_lock(&inode->i_mutex);
It seems hackish to pass a needlock arg to an API, and that that we'll end
up with some conceptually similar call-outs for both caps and setuid.
How about encapsulating this stuff so that there's something like:
err = should_remove_privs();
if (err)
remove_privs();
with
void remove_privs()
{
mutex_lock();
__remove_privs();
mutex_unlock();
}
and then __remove_privs() handles the logic for all file privileges,
including at this stage suid and the LSM call for file caps ?
- James
--
James Morris
<jmorris@...ei.org>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists