提交 e6b1059f 编写于 作者: M Marios Makassikis 提交者: Steve French

cifsd: Fix potential null-ptr-deref in smb2_open()

Fix potential null-ptr-deref in smb2_open().
Signed-off-by: NMarios Makassikis <mmakassikis@freebox.fr>
Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
上级 5626518e
......@@ -2918,13 +2918,16 @@ int smb2_open(struct ksmbd_work *work)
fattr.cf_gid = inode->i_gid;
fattr.cf_mode = inode->i_mode;
fattr.cf_dacls = NULL;
ace_num = 0;
fattr.cf_acls = ksmbd_vfs_get_acl(inode, ACL_TYPE_ACCESS);
ace_num = fattr.cf_acls->a_count;
if (fattr.cf_acls)
ace_num = fattr.cf_acls->a_count;
if (S_ISDIR(inode->i_mode)) {
fattr.cf_dacls =
ksmbd_vfs_get_acl(inode, ACL_TYPE_DEFAULT);
ace_num += fattr.cf_dacls->a_count;
if (fattr.cf_dacls)
ace_num += fattr.cf_dacls->a_count;
}
pntsd = kmalloc(sizeof(struct smb_ntsd) +
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册