[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <673b119e.050a0220.87769.0028.GAE@google.com>
Date: Mon, 18 Nov 2024 02:06:22 -0800
From: syzbot <syzbot+5f0d7af0e45fae10edd1@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] Re: general protection fault in jfs_error()
For archival purposes, forwarding an incoming command email to
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com.
***
Subject: Re: general protection fault in jfs_error()
Author: dmantipov@...dex.ru
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git adc218676eef25575469234709c2d87185ca223a
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index d68a4e6ac345..d2eff3375aad 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -96,24 +96,29 @@ static int jfs_create(struct mnt_idmap *idmap, struct inode *dip,
}
tid = txBegin(dip->i_sb, 0);
+ /* Do not go further if jfs_handle_error() marks us read-only. */
+ if (unlikely(dip->i_sb->s_flags & SB_RDONLY)) {
+ rc = -EROFS;
+ goto out3;
+ }
mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT);
mutex_lock_nested(&JFS_IP(ip)->commit_mutex, COMMIT_MUTEX_CHILD);
rc = jfs_init_acl(tid, ip, dip);
if (rc)
- goto out3;
+ goto out4;
rc = jfs_init_security(tid, ip, dip, &dentry->d_name);
if (rc) {
txAbort(tid, 0);
- goto out3;
+ goto out4;
}
if ((rc = dtSearch(dip, &dname, &ino, &btstack, JFS_CREATE))) {
jfs_err("jfs_create: dtSearch returned %d", rc);
txAbort(tid, 0);
- goto out3;
+ goto out4;
}
tblk = tid_to_tblock(tid);
@@ -140,7 +145,7 @@ static int jfs_create(struct mnt_idmap *idmap, struct inode *dip,
txAbort(tid, 1); /* Marks Filesystem dirty */
} else
txAbort(tid, 0); /* Filesystem full */
- goto out3;
+ goto out4;
}
ip->i_op = &jfs_file_inode_operations;
@@ -155,10 +160,12 @@ static int jfs_create(struct mnt_idmap *idmap, struct inode *dip,
rc = txCommit(tid, 2, &iplist[0], 0);
- out3:
+ out4:
txEnd(tid);
mutex_unlock(&JFS_IP(ip)->commit_mutex);
mutex_unlock(&JFS_IP(dip)->commit_mutex);
+
+ out3:
if (rc) {
free_ea_wmap(ip);
clear_nlink(ip);
Powered by blists - more mailing lists