]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
jbd2: fix potential double free
authorChengguang Xu <cgxu519@gmail.com>
Sat, 11 May 2019 01:15:47 +0000 (21:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2019 05:39:56 +0000 (07:39 +0200)
commitb8bd6257c33d1552195e250a4b1216c98b3a6195
tree31ae19ac698fd3752c007aa81349eb9bd634e31f
parent8e9dbdd685abdd79169214527444e536eb4b0d60
jbd2: fix potential double free

commit 0d52154bb0a700abb459a2cbce0a30fc2549b67e upstream.

When failing from creating cache jbd2_inode_cache, we will destroy the
previously created cache jbd2_handle_cache twice.  This patch fixes
this by moving each cache initialization/destruction to its own
separate, individual function.

Signed-off-by: Chengguang Xu <cgxu519@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/jbd2/journal.c
fs/jbd2/revoke.c
fs/jbd2/transaction.c
include/linux/jbd2.h