[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240528225829.2818-1-hdanton@sina.com>
Date: Wed, 29 May 2024 06:58:29 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+5d34cc6474499a5ff516@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [ntfs3?] KASAN: slab-use-after-free Read in chrdev_open
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
--- x/fs/open.c
+++ y/fs/open.c
@@ -952,7 +952,13 @@ static int do_dentry_open(struct file *f
if (!open)
open = f->f_op->open;
if (open) {
+ struct super_block *sb = inode->i_sb;
+
+ error = -ENODEV;
+ if (!super_trylock_shared(sb))
+ goto cleanup_all;
error = open(inode, f);
+ up_read(&sb->s_umount);
if (error)
goto cleanup_all;
}
--- x/fs/super.c
+++ y/fs/super.c
@@ -503,6 +503,7 @@ void deactivate_super(struct super_block
{
if (!atomic_add_unless(&s->s_active, -1, 1)) {
__super_lock_excl(s);
+ s->s_flags |= SB_DYING;
deactivate_locked_super(s);
}
}
--
Powered by blists - more mailing lists