lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1306596354-18453-2-git-send-email-andi@firstfloor.org>
Date:	Sat, 28 May 2011 08:25:52 -0700
From:	Andi Kleen <andi@...stfloor.org>
To:	viro@...iv.linux.org.uk
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	Andi Kleen <ak@...ux.intel.com>, tytso@....edu
Subject: [PATCH 2/4] EXT4: Set NOSEC flag early when there are no xattrs v2

From: Andi Kleen <ak@...ux.intel.com>

This avoids a xattr lookup on every write.

v2: Use helper
Cc: tytso@....edu
Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
 fs/ext4/ialloc.c |    4 ++++
 fs/ext4/inode.c  |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 21bb2f6..e0aabdb 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -1012,6 +1012,10 @@ got:
 	 */
 	ei->i_flags =
 		ext4_mask_flags(mode, EXT4_I(dir)->i_flags & EXT4_FL_INHERITED);
+	/* 
+ 	 * New inode doesn't have security xattrs. 
+ 	 */
+	inode_has_no_xattr(inode);
 	ei->i_file_acl = 0;
 	ei->i_dtime = 0;
 	ei->i_block_group = group;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index f2fa5e8..1079d02 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4758,6 +4758,12 @@ void ext4_set_inode_flags(struct inode *inode)
 		inode->i_flags |= S_NOATIME;
 	if (flags & EXT4_DIRSYNC_FL)
 		inode->i_flags |= S_DIRSYNC;
+	/*
+	 * Don't know yet if an xattr is really security related, but the first
+	 * write will find out.
+	 */
+	if (!ext4_test_inode_state(inode, EXT4_STATE_XATTR))
+		inode_has_no_xattr(inode);
 }
 
 /* Propagate flags from i_flags to EXT4_I(inode)->i_flags */
-- 
1.7.4.4

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ