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: <1309110205-26433-1-git-send-email-guenter.roeck@ericsson.com>
Date:	Sun, 26 Jun 2011 10:43:25 -0700
From:	Guenter Roeck <guenter.roeck@...csson.com>
To:	Evgeniy Dushistov <dushistov@...l.ru>
CC:	<linux-kernel@...r.kernel.org>,
	Guenter Roeck <guenter.roeck@...csson.com>
Subject: [PATCH] ufs: Fix backtrace seen when mounting a bad ufs file system

If an attempt is made to mount a bad ufs file system, the following backtrace
may be seen.

Call Trace:
[<ffffffff81443d50>] mutex_lock+0x18/0x70
[<ffffffff8127d6cc>] ufs_sync_fs+0x2c/0x278
[<ffffffff8120d814>] __sync_filesystem+0x74/0xb8
[<ffffffff8120d934>] sync_filesystem+0x4c/0x80
[<ffffffff811e23dc>] generic_shutdown_super+0x34/0x110
[<ffffffff811e24dc>] kill_block_super+0x24/0x80
[<ffffffff811e2644>] deactivate_locked_super+0x6c/0x98
[<ffffffff811e32e0>] mount_bdev+0x218/0x220
[<ffffffff811e295c>] mount_fs+0xe4/0x220
[<ffffffff81201064>] vfs_kern_mount+0x64/0x110
[<ffffffff812014fc>] do_kern_mount+0x4c/0x138
[<ffffffff81202d58>] do_mount+0x440/0x898
[<ffffffff8122c870>] compat_sys_mount+0xd8/0x248

The backtrace occurs if ufs_read_cylinder_structures() reports an error.
The calling function ufs_fill_super() tries to clean up, but does not return
the error to the calling code. This ultimately causes the backtrace.

Fix problem by returning an error from ufs_fill_super() if
ufs_read_cylinder_structures() fails.

Signed-off-by: Guenter Roeck <guenter.roeck@...csson.com>
---
 fs/ufs/super.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 3915ade..c398221 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -1174,8 +1174,12 @@ magic_found:
 	 * Read cylinder group structures
 	 */
 	if (!(sb->s_flags & MS_RDONLY))
-		if (!ufs_read_cylinder_structures(sb))
+		if (!ufs_read_cylinder_structures(sb)) {
+			dput(sb->s_root);
+			sb->s_root = NULL;
+			ret = -ENODEV;
 			goto failed;
+		}
 
 	UFSD("EXIT\n");
 	return 0;
-- 
1.7.3.1

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