[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240527235721.2643-1-hdanton@sina.com>
Date: Tue, 28 May 2024 07:57:21 +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
@@ -907,6 +907,7 @@ static int do_dentry_open(struct file *f
static const struct file_operations empty_fops = {};
struct inode *inode = f->f_path.dentry->d_inode;
int error;
+ struct super_block *sb = inode->i_sb;
path_get(&f->f_path);
f->f_inode = inode;
@@ -929,6 +930,7 @@ static int do_dentry_open(struct file *f
f->f_mode |= FMODE_WRITER;
}
+ down_read(&sb->s_umount);
/* POSIX.1-2008/SUSv4 Section XSI 2.9.7 */
if (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))
f->f_mode |= FMODE_ATOMIC_POS;
@@ -956,6 +958,7 @@ static int do_dentry_open(struct file *f
if (error)
goto cleanup_all;
}
+ up_read(&sb->s_umount);
f->f_mode |= FMODE_OPENED;
if ((f->f_mode & FMODE_READ) &&
likely(f->f_op->read || f->f_op->read_iter))
--
Powered by blists - more mailing lists