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>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1304221537480.1341@pobox.suse.cz>
Date:	Mon, 22 Apr 2013 15:40:15 +0200 (CEST)
From:	Jiri Kosina <jkosina@...e.cz>
To:	stable@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH 3.0-stable] Revert "sysfs: fix race between readdir and
 lseek"

This reverts commit 991f76f837bf22c5bb07261cfd86525a0a96650c in Linus' 
tree which is f366c8f271888f48e15cc7c0ab70f184c220c8a4 in 
linux-stable.git

It depends on ef3d0fd27e90f ("vfs: do (nearly) lockless generic_file_llseek")
which is available only in 3.2+.

When applied on 3.0 codebase, it causes A-A deadlock, whenever anyone does
seek() on sysfs, as both generic_file_llseek() and sysfs_dir_llseek() obtain
i_mutex.

Signed-off-by: Jiri Kosina <jkosina@...e.cz>
---
 fs/sysfs/dir.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

Index: linux-3.0-SLE11-SP3-sysfs-hang-debug/fs/sysfs/dir.c
===================================================================
--- linux-3.0-SLE11-SP3-sysfs-hang-debug.orig/fs/sysfs/dir.c
+++ linux-3.0-SLE11-SP3-sysfs-hang-debug/fs/sysfs/dir.c
@@ -961,21 +961,9 @@ static int sysfs_readdir(struct file * f
 	return 0;
 }
 
-static loff_t sysfs_dir_llseek(struct file *file, loff_t offset, int whence)
-{
-	struct inode *inode = file->f_path.dentry->d_inode;
-	loff_t ret;
-
-	mutex_lock(&inode->i_mutex);
-	ret = generic_file_llseek(file, offset, whence);
-	mutex_unlock(&inode->i_mutex);
-
-	return ret;
-}
-
 const struct file_operations sysfs_dir_operations = {
 	.read		= generic_read_dir,
 	.readdir	= sysfs_readdir,
 	.release	= sysfs_dir_release,
-	.llseek		= sysfs_dir_llseek,
+	.llseek		= generic_file_llseek,
 };

-- 
Jiri Kosina
SUSE Labs
--
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