From: Benjamin LaHaise <bcrl@kvack.org>
To: Kylene Jo Hall <kjhall@us.ibm.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
LSM ML <linux-security-module@vger.kernel.org>,
Dave Safford <safford@us.ibm.com>, Mimi Zohar <zohar@us.ibm.com>,
Serge Hallyn <sergeh@us.ibm.com>
Subject: Re: [PATCH 3/7] SLIM main patch
Date: Wed, 23 Aug 2006 15:27:33 -0400 [thread overview]
Message-ID: <20060823192733.GG28594@kvack.org> (raw)
In-Reply-To: <1156359937.6720.66.camel@localhost.localdomain>
On Wed, Aug 23, 2006 at 12:05:37PM -0700, Kylene Jo Hall wrote:
> +/*
> + * Called with current->files->file_lock. There is not a great lock to grab
> + * for demotion of this type. The only place f_mode is changed after install
> + * is in mark_files_ro in the filesystem code. That function is also changing
> + * taking away write rights so even if we race the outcome is the same.
> + */
> +static inline void do_revoke_file_wperm(struct file *file,
> + struct slm_file_xattr *cur_level)
> +{
> + struct inode *inode;
> + struct slm_isec_data *isec;
> +
> + inode = file->f_dentry->d_inode;
> + if (!S_ISREG(inode->i_mode) || !(file->f_mode && FMODE_WRITE))
> + return;
> +
> + isec = inode->i_security;
> + spin_lock(&isec->lock);
> + if (is_lower_integrity(cur_level, &isec->level))
> + file->f_mode &= ~FMODE_WRITE;
> + spin_unlock(&isec->lock);
> +}
This function does not do what you claim or hope it is supposed to do.
Looking at the races (you do nothing to shoot down writes that are in
progress) present, this does not instill confidence in the rest of the
code (as always seems to be the case with new security frameworks or
patches). Cheers,
-ben
next prev parent reply other threads:[~2006-08-23 19:27 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-23 19:05 [PATCH 3/7] SLIM main patch Kylene Jo Hall
2006-08-23 19:27 ` Benjamin LaHaise [this message]
2006-08-23 20:35 ` Kylene Jo Hall
2006-08-23 20:41 ` Benjamin LaHaise
2006-08-23 22:20 ` Kylene Jo Hall
2006-08-24 8:31 ` Arjan van de Ven
2006-08-24 11:26 ` Alan Cox
2006-08-24 13:32 ` Serge E. Hallyn
2006-08-24 13:37 ` Benjamin LaHaise
2006-08-24 13:58 ` Serge E. Hallyn
2006-08-24 14:00 ` Benjamin LaHaise
2006-08-24 14:16 ` Serge E. Hallyn
2006-08-24 14:15 ` Alan Cox
2006-08-24 15:23 ` Serge E. Hallyn
2006-08-24 17:05 ` Alan Cox
2006-08-24 17:34 ` David Safford
2006-08-24 19:16 ` Serge E. Hallyn
2006-08-24 20:21 ` David Safford
2006-08-24 20:41 ` Mimi Zohar
2006-08-24 22:13 ` Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2006-09-12 17:57 Kylene Jo Hall
2006-09-14 23:52 ` Andrew Morton
2006-09-15 16:57 ` Kylene Jo Hall
2006-09-26 18:44 ` Stephen Smalley
2006-10-19 20:48 ` Kylene Jo Hall
2006-10-20 15:32 ` Stephen Smalley
2006-10-20 17:58 ` Stephen Smalley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060823192733.GG28594@kvack.org \
--to=bcrl@kvack.org \
--cc=kjhall@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=safford@us.ibm.com \
--cc=sergeh@us.ibm.com \
--cc=zohar@us.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox