Commit 4a10041e authored by Eric Biggers's avatar Eric Biggers Committed by zhaoxiaoqiang11
Browse files

ext4: don't set up encryption key during jbd2 transaction

stable inclusion
from stable-v5.10.163
commit 23ad034760dd38e12b0e0e1b28b9629f330810a1
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7PJ9N

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=23ad034760dd38e12b0e0e1b28b9629f330810a1



----------------------------------------------------

commit 4c0d5778 upstream.

Commit a80f7fcf ("ext4: fixup ext4_fc_track_* functions' signature")
extended the scope of the transaction in ext4_unlink() too far, making
it include the call to ext4_find_entry().  However, ext4_find_entry()
can deadlock when called from within a transaction because it may need
to set up the directory's encryption key.

Fix this by restoring the transaction to its original scope.

Reported-by: default avatar <syzbot+1a748d0007eeac3ab079@syzkaller.appspotmail.com>
Fixes: a80f7fcf ("ext4: fixup ext4_fc_track_* functions' signature")
Cc: <stable@vger.kernel.org> # v5.10+
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20221106224841.279231-3-ebiggers@kernel.org


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
parent c74bae99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment