diff options
author | Namjae Jeon <linkinjeon@kernel.org> | 2021-12-01 10:12:39 +0900 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2021-12-16 12:36:49 -0600 |
commit | f2e78affc48dee29b989c1d9b0d89b503dcd1204 (patch) | |
tree | 2f35e1d2b24462ac0a5642199fdfbbf8ef125ea5 /fs/ksmbd | |
parent | ef399469d9ceb9f2171cdd79863f9434b9fa3edc (diff) | |
download | linux-f2e78affc48dee29b989c1d9b0d89b503dcd1204.tar.bz2 |
ksmbd: fix uninitialized symbol 'pntsd_size'
No check for if "rc" is an error code for build_sec_desc().
This can cause problems with using uninitialized pntsd_size.
Fixes: e2f34481b24d ("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>
Diffstat (limited to 'fs/ksmbd')
-rw-r--r-- | fs/ksmbd/smb2pdu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index 49c9da37315c..125590d5e940 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -2962,6 +2962,10 @@ int smb2_open(struct ksmbd_work *work) &pntsd_size, &fattr); posix_acl_release(fattr.cf_acls); posix_acl_release(fattr.cf_dacls); + if (rc) { + kfree(pntsd); + goto err_out; + } rc = ksmbd_vfs_set_sd_xattr(conn, user_ns, |