[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240529114906.2905-1-hdanton@sina.com>
Date: Wed, 29 May 2024 19:49:06 +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
@@ -906,9 +906,13 @@ static int do_dentry_open(struct file *f
{
static const struct file_operations empty_fops = {};
struct inode *inode = f->f_path.dentry->d_inode;
+ struct dentry *d = f->f_path.dentry;
int error;
+ if (!lockref_get_not_zero(&d->d_lockref))
+ return -ENODEV;
path_get(&f->f_path);
+ dput(d);
f->f_inode = inode;
f->f_mapping = inode->i_mapping;
f->f_wb_err = filemap_sample_wb_err(f->f_mapping);
--
Powered by blists - more mailing lists