]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ext4: fix possible use after free with metadata csum
authorTheodore Ts'o <tytso@mit.edu>
Fri, 30 Nov 2012 02:21:22 +0000 (21:21 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 30 Nov 2012 02:21:22 +0000 (21:21 -0500)
commitaeb1e5d69a5be592e86a926be73efb38c55af404
treeaddd38abf4d74fc6fd54829cff1c3fb9fb832c31
parent69c499d152a7fe2c4443e5ddd91568ad5a79145a
ext4: fix possible use after free with metadata csum

Commit fa77dcfafeaa introduces block bitmap checksum calculation into
ext4_new_inode() in the case that block group was uninitialized.
However we brelse() the bitmap buffer before we attempt to checksum it
so we have no guarantee that the buffer is still there.

Fix this by releasing the buffer after the possible checksum
computation.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Acked-by: Darrick J. Wong <darrick.wong@oracle.com>
Cc: stable@vger.kernel.org
fs/ext4/ialloc.c