From f881e55b4abc28874253646f5cebee37ea7745be Mon Sep 17 00:00:00 2001 From: zhangkaixiang Date: Tue, 17 Jan 2023 18:53:18 +0800 Subject: [PATCH] hmdfs: fix up the problem of readdir UAF ohos inclusion category: bugfix issue: #I6AX84 CVE: NA ---------------------------------------------- fix up the problem of readdir UAF Signed-off-by: zhangkaixiang --- fs/hmdfs/inode_remote.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/hmdfs/inode_remote.c b/fs/hmdfs/inode_remote.c index 73d459bf4533..c9bd5275c8fd 100644 --- a/fs/hmdfs/inode_remote.c +++ b/fs/hmdfs/inode_remote.c @@ -121,12 +121,13 @@ static void hmdfs_remote_readdir_work(struct work_struct *work) hmdfs_d(dentry)->async_readdir_in_progress = 0; hmdfs_revert_creds(old_cred); - dput(dentry); - peer_put(con); spin_lock(&con->sbi->async_readdir_work_lock); list_del(&rw->head); empty = list_empty(&con->sbi->async_readdir_work_list); spin_unlock(&con->sbi->async_readdir_work_lock); + + dput(dentry); + peer_put(con); kfree(rw); if (empty) -- Gitee