2024-01-31 07:47:04

by Edward Adam Davis

[permalink] [raw]
Subject: Re: [syzbot] [xfs?] [ext4?] general protection fault in jbd2__journal_start

please test general protection fault in jbd2__journal_start

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index cb0b8d6fc0c6..702312cd5392 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -493,6 +493,9 @@ handle_t *jbd2__journal_start(journal_t *journal, int nblocks, int rsv_blocks,
return ERR_PTR(-EROFS);

if (handle) {
+ if (handle->saved_alloc_context & ~PF_MEMALLOC_NOFS)
+ return ERR_PTR(-EBUSY);
+
J_ASSERT(handle->h_transaction->t_journal == journal);
handle->h_ref++;
return handle;



2024-01-31 11:17:42

by syzbot

[permalink] [raw]
Subject: Re: [syzbot] [xfs?] [ext4?] general protection fault in jbd2__journal_start

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: [email protected]

Tested on:

commit: 1bbb19b6 Merge tag 'erofs-for-6.8-rc3-fixes' of git://..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=16f6172fe80000
kernel config: https://syzkaller.appspot.com/x/.config?x=b0b9993d7d6d1990
dashboard link: https://syzkaller.appspot.com/bug?extid=cdee56dbcdf0096ef605
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=17477cb0180000

Note: testing is done by a robot and is best-effort only.