linux/fs/jbd2
Theodore Ts'o 0b174dbe64 ext4: set h_journal if there is a failure starting a reserved handle
commit b2569260d5 upstream.

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".

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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-10-21 08:45:30 +01:00
..
checkpoint.c jbd2: avoid infinite loop when destroying aborted journal 2015-10-19 11:17:07 +01:00
commit.c jbd2: avoid infinite loop when destroying aborted journal 2015-10-19 11:17:07 +01:00
journal.c jbd2: if the journal is aborted then don't allow update of the log tail 2018-10-21 08:44:48 +01: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: fix r_count overflows leading to buffer overflow in journal recovery 2015-05-28 10:00:03 +01:00
revoke.c jbd2: fix r_count overflows leading to buffer overflow in journal recovery 2015-05-28 10:00:03 +01:00
transaction.c ext4: set h_journal if there is a failure starting a reserved handle 2018-10-21 08:45:30 +01:00