mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-23 12:14:10 +08:00
fs/9p: fix uaf in in v9fs_stat2inode_dotl
The incorrect logical order of accessing the st object code in v9fs_fid_iget_dotl
is causing this uaf.
Fixes: 724a08450f
("fs/9p: simplify iget to remove unnecessary paths")
Reported-and-tested-by: syzbot+7a3d75905ea1a830dbe5@syzkaller.appspotmail.com
Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
Tested-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Dominique Martinet <asmadeus@codewreck.org>
Signed-off-by: Eric Van Hensbergen <ericvh@kernel.org>
This commit is contained in:
parent
4cece76496
commit
11763a8598
@ -78,11 +78,11 @@ struct inode *v9fs_fid_iget_dotl(struct super_block *sb, struct p9_fid *fid)
|
||||
|
||||
retval = v9fs_init_inode(v9ses, inode, &fid->qid,
|
||||
st->st_mode, new_decode_dev(st->st_rdev));
|
||||
v9fs_stat2inode_dotl(st, inode, 0);
|
||||
kfree(st);
|
||||
if (retval)
|
||||
goto error;
|
||||
|
||||
v9fs_stat2inode_dotl(st, inode, 0);
|
||||
v9fs_set_netfs_context(inode);
|
||||
v9fs_cache_inode_get_cookie(inode);
|
||||
retval = v9fs_get_acl(inode, fid);
|
||||
|
Loading…
Reference in New Issue
Block a user