public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+2c4a3b922a860084cc7f@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [ext4?] WARNING in lock_two_nondirectories
Date: Sun, 24 Dec 2023 17:14:09 +0800	[thread overview]
Message-ID: <tencent_DECFB60DE7258B8DBB121FDDC75DCF191707@qq.com> (raw)
In-Reply-To: <000000000000e17185060c8caaad@google.com>

please test WARNING in lock_two_nondirectories

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

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 61277f7f8722..692376f3ce0a 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4710,6 +4710,7 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino,
 	}
 
 	inode = iget_locked(sb, ino);
+	printk("ino: %u, in: %p, %s\n", ino, inode, __func__);
 	if (!inode)
 		return ERR_PTR(-ENOMEM);
 	if (!(inode->i_state & I_NEW)) {
@@ -4944,8 +4945,13 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino,
 		inode->i_fop = &ext4_file_operations;
 		ext4_set_aops(inode);
 	} else if (S_ISDIR(inode->i_mode)) {
-		inode->i_op = &ext4_dir_inode_operations;
-		inode->i_fop = &ext4_dir_operations;
+		printk("i: %p, %s\n", inode, __func__);
+		if (ino == EXT4_BOOT_LOADER_INO)
+			make_bad_inode(inode);
+		else {
+			inode->i_op = &ext4_dir_inode_operations;
+			inode->i_fop = &ext4_dir_operations;
+		}
 	} else if (S_ISLNK(inode->i_mode)) {
 		/* VFS does not allow setting these so must be corruption */
 		if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) {


  reply	other threads:[~2023-12-24  9:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15 13:49 [syzbot] [ext4?] WARNING in lock_two_nondirectories syzbot
2023-12-24  9:14 ` Edward Adam Davis [this message]
2023-12-24  9:37   ` syzbot
2023-12-24 11:53 ` [PATCH] ext4: fix " Edward Adam Davis
2023-12-24 14:13   ` Matthew Wilcox
2023-12-25  1:38   ` Baokun Li
2023-12-25  2:07     ` Al Viro
2023-12-25  2:33       ` Baokun Li
2023-12-25  2:49         ` Theodore Ts'o
2023-12-25  2:56           ` Baokun Li
2023-12-25  2:11     ` Theodore Ts'o
2023-12-25  2:15       ` Al Viro
2023-12-25  2:46       ` Baokun Li
2024-02-12  0:00 ` [syzbot] [ext4?] " syzbot
2024-02-12 13:28   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_DECFB60DE7258B8DBB121FDDC75DCF191707@qq.com \
    --to=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+2c4a3b922a860084cc7f@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox