OSDN Git Service

libext2fs: ext2fs_dup_handle should not alias MMP buffers
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 9 Sep 2013 14:39:29 +0000 (10:39 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 9 Sep 2013 14:39:33 +0000 (10:39 -0400)
commit816d2c9cf7fb17fe808a081e076cb558f44ec30d
tree61316f1ddbfe234adf877f3d4f281d790c7c3515
parent7ff040f30f0ff3bf5e2c832da3cb577e00a52d60
libext2fs: ext2fs_dup_handle should not alias MMP buffers

It turns out that resize2fs uses ext2fs_dup_handle to duplicate fs handles.  If
MMP is enabled, this causes both handles to share MMP buffers, which is bad
news when it comes time to free both handles.  Change the code to (we hope) fix
this.  This prevents resize2fs from failing with a double-free error when
handed a MMP filesystem.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/dupfs.c