2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-21 11:44:01 +08:00
linux-next/fs/jbd2
Theodore Ts'o b2569260d5 ext4: set h_journal if there is a failure starting a reserved handle
If ext4 tries to start a reserved handle via
jbd2_journal_start_reserved(), and the journal has been aborted, this
can result in a NULL pointer dereference.  This is because the fields
h_journal and h_transaction in the handle structure share the same
memory, via a union, so jbd2_journal_start_reserved() will clear
h_journal before calling start_this_handle().  If this function fails
due to an aborted handle, h_journal will still be NULL, and the call
to jbd2_journal_free_reserved() will pass a NULL journal to
sub_reserve_credits().

This can be reproduced by running "kvm-xfstests -c dioread_nolock
generic/475".

Cc: stable@kernel.org # 3.11
Fixes: 8f7d89f368 ("jbd2: transaction reservation support")
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Reviewed-by: Jan Kara <jack@suse.cz>
2018-04-18 11:49:31 -04:00
..
checkpoint.c ext4: fix up remaining files with SPDX cleanups 2017-12-17 22:00:59 -05:00
commit.c ext4: fix up remaining files with SPDX cleanups 2017-12-17 22:00:59 -05:00
journal.c jbd2: if the journal is aborted then don't allow update of the log tail 2018-02-19 12:22:53 -05:00
Kconfig jbd2: remove debug dependency on debug_fs and update Kconfig help text 2013-06-12 23:07:51 -04:00
Makefile [PATCH] jbd2: rename jbd2 symbols to avoid duplication of jbd symbols 2006-10-11 11:14:15 -07:00
recovery.c jbd2: clarify bad journal block checksum message 2018-02-18 21:33:13 -05:00
revoke.c ext4: fix up remaining files with SPDX cleanups 2017-12-17 22:00:59 -05:00
transaction.c ext4: set h_journal if there is a failure starting a reserved handle 2018-04-18 11:49:31 -04:00