Re: [RFC]selinux: Improving SELinux read/write performance

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Yuichi Nakamura <ynakam@...>
Cc: <selinux@...>, <busybox@...>, James Morris <jmorris@...>, Eric Paris <eparis@...>, <kaigai@...>, <linux-security-module@...>, <linux-kernel@...>
Date: Thursday, September 13, 2007 - 8:58 am

On Wed, 2007-09-12 at 17:51 +0900, Yuichi Nakamura wrote:

Thanks, a few comments below.


I think I'd reword this a little, e.g.

It reduces the selinux overhead on read/write by only revalidating
permissions in selinux_file_permission if the task or inode labels have
changed or the policy has changed since the open-time check.  A new LSM
hook, security_dentry_open, is added to capture the necessary state at
open time to allow this optimization.

<snip>

Leftover from prior version of the patch, no longer needed.

<snip>

I'd add a comment here, e.g.
	  /* 
	   * Save inode label and policy sequence number
	   * at open-time so that selinux_file_permission
	   * can determine whether revalidation is necessary.
	   * Task label is already saved in the file security
           * struct as its SID.
	   */


Typo in the comment (s/of/or/), coding style isn't right for a
multi-line comment, and likely needs clarification, e.g.
	/*
	 * Since the inode label or policy seqno may have changed
	 * between the selinux_inode_permission check and the saving
	 * of state above, recheck that access is still permitted.
	 * Otherwise, access might never be revalidated against the
	 * new inode label or new policy.
	 * This check is not redundant - do not remove. 
	 */



Extraneous whitespace leftover from prior version of the patch.


More precisely, "Save open-time permission checking state for later use
upon file_permission, and recheck access if anything has changed since
inode_permission."
  
-- 
Stephen Smalley
National Security Agency

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC]selinux: Improving SELinux read/write performance, Yuichi Nakamura, (Thu Sep 6, 3:27 am)
Re: [RFC]selinux: Improving SELinux read/write performance, Stephen Smalley, (Thu Sep 6, 9:47 am)
Re: [RFC]selinux: Improving SELinux read/write performance, Yuichi Nakamura, (Sun Sep 9, 9:31 pm)
Re: [RFC]selinux: Improving SELinux read/write performance, Stephen Smalley, (Mon Sep 10, 9:02 am)
Re: [RFC]selinux: Improving SELinux read/write performance, Yuichi Nakamura, (Wed Sep 12, 4:51 am)
Re: [RFC]selinux: Improving SELinux read/write performance, Stephen Smalley, (Thu Sep 13, 8:58 am)
Re: [RFC]selinux: Improving SELinux read/write performance, Yuichi Nakamura, (Thu Sep 13, 8:10 pm)