1
0
Fork 0
remarkable-linux/fs/jbd2
Theodore Ts'o 4a3674acbf 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".

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-01 12:58:06 -07: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
checkpoint.c block,fs: use REQ_* flags directly 2016-11-01 09:43:26 -06:00
commit.c jbd2: don't clear and reset errors after waiting on writeback 2017-07-06 07:02:22 -04:00
journal.c ext4: pass -ESHUTDOWN code to jbd2 layer 2018-04-24 09:36:30 +02:00
recovery.c fs: have ll_rw_block users pass in op and flags separately 2016-06-07 13:41:38 -06:00
revoke.c jbd2: don't leak memory if setting up journal fails 2017-03-15 15:08:48 -04:00
transaction.c ext4: set h_journal if there is a failure starting a reserved handle 2018-05-01 12:58:06 -07:00