Skip to content

Commit f43ba86

Browse files
namjaejeongregkh
authored andcommitted
ksmbd: fix uninitialized symbol 'pntsd_size'
commit f2e78af upstream. No check for if "rc" is an error code for build_sec_desc(). This can cause problems with using uninitialized pntsd_size. Fixes: e2f3448 ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org # v5.15 Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 89d0ffb commit f43ba86

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

fs/ksmbd/smb2pdu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,6 +2964,10 @@ int smb2_open(struct ksmbd_work *work)
29642964
&pntsd_size, &fattr);
29652965
posix_acl_release(fattr.cf_acls);
29662966
posix_acl_release(fattr.cf_dacls);
2967+
if (rc) {
2968+
kfree(pntsd);
2969+
goto err_out;
2970+
}
29672971

29682972
rc = ksmbd_vfs_set_sd_xattr(conn,
29692973
user_ns,

0 commit comments

Comments
 (0)