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: <20100404210302.GL18524@thunk.org>
Date:	Sun, 4 Apr 2010 17:03:02 -0400
From:	tytso@....edu
To:	Eric Sandeen <sandeen@...hat.com>
Cc:	ext4 development <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] ext4_freeze: don't return to userspace with a mutex
 held

On Sun, Apr 04, 2010 at 04:52:37PM -0400, tytso@....EDU wrote:
> On Mon, Mar 29, 2010 at 05:34:43PM -0500, Eric Sandeen wrote:
> > 
> > I don't -think- we need to do this; by now we should have s_frozen
> > set, and nobody else should be coming down the pipe to get to
> > the journal.  However, just to be on the safe side, I added
> > a couple of vfs_check_frozen() calls in ext4 functions which will
> > arrive at start_this_handle(), which should ensure that we never
> > get any journal traffic generated while frozen.
> 
> Um, I think the addition of vfs_check_frozen(), esp. to
> ext4_journal_start_sb() is absolutely necessary.  What else do we have
> to prevent filesystem modifications from going to the file systme
> layer?  I didn't see anything in the VFS layer that checks s_frozen;
> am I missing something?

Added to the ext4 patch queue, with the following patch comment:

ext4: don't return to userspace after freezing the fs with a mutex held

ext4_freeze() used jbd2_journal_lock_updates() which takes
the j_barrier mutex, and then returns to userspace.  The
kernel does not like this:

================================================
[ BUG: lock held when returning to user space! ]
------------------------------------------------
lvcreate/1075 is leaving the kernel with locks still held!
1 lock held by lvcreate/1075:
 #0:  (&journal->j_barrier){+.+...}, at: [<ffffffff811c6214>]
jbd2_journal_lock_updates+0xe1/0xf0

Use vfs_check_frozen() added to ext4_journal_start_sb() and
ext4_force_commit() instead.

Addresses-Red-Hat-Bugzilla: #568503

Signed-off-by: Eric Sandeen <sandeen@...hat.com>
Signed-off-by: "Theodore Ts'o" <tytso@....edu>


					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ