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: <1257156307-24175-4-git-send-email-jblunck@suse.de>
Date:	Mon,  2 Nov 2009 11:04:43 +0100
From:	Jan Blunck <jblunck@...e.de>
To:	linux-fsdevel@...r.kernel.org
Cc:	Matthew Wilcox <matthew@....cx>, linux-kernel@...r.kernel.org,
	Jan Blunck <jblunck@...e.de>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Subject: [PATCH 03/27] BKL: Remove BKL from simple_fill_super

simple_fill_super is used in following filesystems that don't use the BKL
otherwise:
- security/selinux/selinuxfs.c
- security/inode.c
- security/smack/smackfs.c
- drivers/infiniband/hw/ipath/ipath_fs.c
- drivers/xen/xenfs/super.c
- fs/debugfs/inode.c

It is used in following filesystems that make use of the BKL:
- fs/fuse/control.c
- fs/binfmt_misc.c
- fs/nfsd/nfsctl.c

All three filesystems protect the call to simple_fill_super() by the BKL
themself. Therefore it is safe to remove the BKL from simpe_fill_super().

Signed-off-by: Jan Blunck <jblunck@...e.de>
---
 fs/libfs.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/libfs.c b/fs/libfs.c
index 3484040..4a70729 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -11,7 +11,6 @@
 #include <linux/exportfs.h>
 #include <linux/writeback.h>
 #include <linux/buffer_head.h>
-#include <linux/smp_lock.h> /* Only for lock_kernel() */
 
 #include <asm/uaccess.h>
 
@@ -423,8 +422,6 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files
 	struct dentry *dentry;
 	int i;
 
-	lock_kernel();
-
 	s->s_blocksize = PAGE_CACHE_SIZE;
 	s->s_blocksize_bits = PAGE_CACHE_SHIFT;
 	s->s_magic = magic;
@@ -432,10 +429,9 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files
 	s->s_time_gran = 1;
 
 	inode = new_inode(s);
-	if (!inode) {
-		unlock_kernel();
+	if (!inode)
 		return -ENOMEM;
-	}
+
 	/*
 	 * because the root inode is 1, the files array must not contain an
 	 * entry at index 1
@@ -449,7 +445,6 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files
 	root = d_alloc_root(inode);
 	if (!root) {
 		iput(inode);
-		unlock_kernel();
 		return -ENOMEM;
 	}
 	for (i = 0; !files->name || files->name[0]; i++, files++) {
@@ -475,12 +470,10 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files
 		d_add(dentry, inode);
 	}
 	s->s_root = root;
-	unlock_kernel();
 	return 0;
 out:
 	d_genocide(root);
 	dput(root);
-	unlock_kernel();
 	return -ENOMEM;
 }
 
-- 
1.6.4.2

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