]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ext4: fix potential use after free in __ext4_journal_stop
authorLukas Czerner <lczerner@redhat.com>
Sun, 18 Oct 2015 02:57:06 +0000 (22:57 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 5 Feb 2016 03:33:20 +0000 (19:33 -0800)
commitaf7da607ba94589d4f68989b8a0b2cec2e0ba8c6
tree2442787275ecbf1e5e39a41fbb1bbff016868a54
parent87ae3e4bbdd512d1487e630184ab6a4d86d1264a
ext4: fix potential use after free in __ext4_journal_stop

Orabug: 22623870

commit 6934da9238da947628be83635e365df41064b09b upstream.

There is a use-after-free possibility in __ext4_journal_stop() in the
case that we free the handle in the first jbd2_journal_stop() because
we're referencing handle->h_err afterwards. This was introduced in
9705acd63b125dee8b15c705216d7186daea4625 and it is wrong. Fix it by
storing the handle->h_err value beforehand and avoid referencing
potentially freed handle.

Fixes: 9705acd63b125dee8b15c705216d7186daea4625
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 456dd91e06dd5194d263c0693811852308c4cc09)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
fs/ext4/ext4_jbd2.c