]> git.baikalelectronics.ru Git - kernel.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)
commit7748c0984db6544800c87bd121073ca37cf0ed63
treeaddd38abf4d74fc6fd54829cff1c3fb9fb832c31
parent8b1b908291f7b4f7d33df43162fc8e0eec50ddf2
ext4: fix possible use after free with metadata csum

Commit 3e0ccfe72230 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