From: Al Viro Date: Sat, 18 May 2013 06:38:52 +0000 (-0400) Subject: hpfs: deadlock and race in directory lseek() X-Git-Tag: v3.2.56~19 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b89ff066efab68d53a3a060b2c7d9089f8afa8ea;p=pandora-kernel.git hpfs: deadlock and race in directory lseek() commit 31abdab9c11bb1694ecd1476a7edbe8e964d94ac upstream. For one thing, there's an ABBA deadlock on hpfs fs-wide lock and i_mutex in hpfs_dir_lseek() - there's a lot of methods that grab the former with the caller already holding the latter, so it must take i_mutex first. For another, locking the damn thing, carefully validating the offset, then dropping locks and assigning the offset is obviously racy. Moreover, we _must_ do hpfs_add_pos(), or the machinery in dnode.c won't modify the sucker on B-tree surgeries. Signed-off-by: Al Viro Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed