linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vfs: new FROM_ACCESS flag
@ 2009-09-21  1:30 Eric Paris
  2009-09-21  8:20 ` Jamie Lokier
  2009-09-22 13:56 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Paris @ 2009-09-21  1:30 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel; +Cc: viro, hch

This new acc_mode flag is just to tell the security system this inode
permission check is from the access system call.  The security system can
use this information as it finds appropriete.  In particular SELinux plans to
use this flag to alter what we choose to audit and what we do not choose to
audit.

Signed-off-by: Eric Paris <eparis@redhat.com>
---

 fs/open.c          |    2 +-
 include/linux/fs.h |    5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index 1940498..ad9e17f 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -495,7 +495,7 @@ SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
 			goto out_path_release;
 	}
 
-	res = inode_permission(inode, mode | MAY_ACCESS);
+	res = inode_permission(inode, mode | MAY_ACCESS | FROM_ACCESS);
 	/* SuS v2 requires we report a read only fs too */
 	if (res || !(mode & S_IWOTH) || special_file(inode->i_mode))
 		goto out_path_release;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5df69f0..7ff00dc 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -60,6 +60,11 @@ struct inodes_stat_t {
  */
 #define MAY_ACCESS 16
 #define MAY_OPEN 32
+/*
+ * This flag is only set in the access() and accessat() syscalls and can
+ * be used by the security system as it deems reasonable.
+ */
+#define FROM_ACCESS 64
 
 /*
  * flags in file.f_mode.  Note that FMODE_READ and FMODE_WRITE must correspond


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-09-23  8:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-21  1:30 [PATCH] vfs: new FROM_ACCESS flag Eric Paris
2009-09-21  8:20 ` Jamie Lokier
2009-09-22 13:56 ` Christoph Hellwig
2009-09-22 17:28   ` Eric Paris
2009-09-22 20:06     ` Christoph Hellwig
2009-09-23  8:48       ` Jamie Lokier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).