mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
ksmbd: fix possible refcount leak in smb2_open()
[ Upstream commit2624b44554] Reference count of acls will leak when memory allocation fails. Fix this by adding the missing posix_acl_release(). Fixes:e2f34481b2("cifsd: add server-side procedures for SMB3") Signed-off-by: ChenXiaoSong <chenxiaosong2@huawei.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a4e6cd9253
commit
303f8e58cc
@@ -2994,8 +2994,11 @@ int smb2_open(struct ksmbd_work *work)
|
||||
sizeof(struct smb_acl) +
|
||||
sizeof(struct smb_ace) * ace_num * 2,
|
||||
GFP_KERNEL);
|
||||
if (!pntsd)
|
||||
if (!pntsd) {
|
||||
posix_acl_release(fattr.cf_acls);
|
||||
posix_acl_release(fattr.cf_dacls);
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
rc = build_sec_desc(user_ns,
|
||||
pntsd, NULL, 0,
|
||||
|
||||
Reference in New Issue
Block a user