linux/fs/smb/server
Namjae Jeon 414849040f ksmbd: fix Null pointer dereferences in ksmbd_update_fstate()
Coverity Scan report the following one. This report is a false alarm.
Because fp is never NULL when rc is zero. This patch add null check for fp
in ksmbd_update_fstate to make alarm silence.

*** CID 1568583:  Null pointer dereferences  (FORWARD_NULL)
/fs/smb/server/smb2pdu.c: 3408 in smb2_open()
3402                    path_put(&path);
3403                    path_put(&parent_path);
3404            }
3405            ksmbd_revert_fsids(work);
3406     err_out1:
3407            if (!rc) {
>>>     CID 1568583:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "fp" to "ksmbd_update_fstate", which dereferences it.
3408                    ksmbd_update_fstate(&work->sess->file_table, fp, FP_INITED);
3409                    rc = ksmbd_iov_pin_rsp(work, (void *)rsp, iov_len);
3410            }
3411            if (rc) {
3412                    if (rc == -EINVAL)
3413                            rsp->hdr.Status = STATUS_INVALID_PARAMETER;

Fixes: e2b76ab8b5 ("ksmbd: add support for read compound")
Reported-by: Coverity Scan <scan-admin@coverity.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
2023-10-12 22:44:09 -05:00
..
mgmt ksmbd: fix race condition between tree conn lookup and disconnect 2023-10-04 21:56:28 -05:00
asn1.c ksmbd: switch to use kmemdup_nul() helper 2023-08-29 12:30:19 -05:00
asn1.h
auth.c ksmbd: fix slub overflow in ksmbd_decode_ntlmssp_auth_blob() 2023-08-29 12:30:20 -05:00
auth.h
connection.c ksmbd: fix race condition between session lookup and expire 2023-10-04 20:21:48 -05:00
connection.h ksmbd: fix race condition between session lookup and expire 2023-10-04 20:21:48 -05:00
crypto_ctx.c
crypto_ctx.h
glob.h
Kconfig ksmbd: remove experimental warning 2023-09-03 21:06:36 -05:00
ksmbd_netlink.h ksmbd: check if a mount point is crossed during path lookup 2023-07-23 10:25:11 -05:00
ksmbd_spnego_negtokeninit.asn1
ksmbd_spnego_negtokentarg.asn1
ksmbd_work.c ksmbd: fix wrong interim response on compound 2023-08-29 12:30:19 -05:00
ksmbd_work.h ksmbd: fix wrong interim response on compound 2023-08-29 12:30:19 -05:00
Makefile
misc.c
misc.h
ndr.c
ndr.h
nterr.h
ntlmssp.h
oplock.c ksmbd: fix wrong DataOffset validation of create context 2023-08-29 12:30:20 -05:00
oplock.h
server.c ksmbd: fix race condition between tree conn lookup and disconnect 2023-10-04 21:56:28 -05:00
server.h
smb2misc.c ksmbd: return invalid parameter error response if smb2 request is invalid 2023-09-21 14:41:06 -05:00
smb2ops.c
smb2pdu.c ksmbd: fix wrong error response status by using set_smb2_rsp_status() 2023-10-12 22:44:05 -05:00
smb2pdu.h ksmbd: replace one-element array with flex-array member in struct smb2_ea_info 2023-08-29 12:30:20 -05:00
smb_common.c ksmbd: add support for read compound 2023-08-29 12:30:19 -05:00
smb_common.h ksmbd: fix out of bounds in init_smb2_rsp_hdr() 2023-07-23 10:25:11 -05:00
smbacl.c ksmbd: remove unneeded mark_inode_dirty in set_info_sec() 2023-09-13 10:21:05 -05:00
smbacl.h
smbfsctl.h
smbstatus.h
transport_ipc.c ksmbd: use kvzalloc instead of kvmalloc 2023-06-26 00:07:04 -05:00
transport_ipc.h
transport_rdma.c ksmbd: reduce descriptor size if remaining bytes is less than request size 2023-08-29 12:30:20 -05:00
transport_rdma.h
transport_tcp.c
transport_tcp.h
unicode.c fs/smb: Swing unicode common code from smb->NLS 2023-08-30 08:55:51 -05:00
unicode.h fs/smb: Swing unicode common code from smb->NLS 2023-08-30 08:55:51 -05:00
vfs_cache.c ksmbd: fix Null pointer dereferences in ksmbd_update_fstate() 2023-10-12 22:44:09 -05:00
vfs_cache.h ksmbd: fix race condition with fp 2023-10-04 20:21:48 -05:00
vfs.c ten ksmbd server fixes 2023-08-31 15:28:26 -07:00
vfs.h ksmbd: add support for read compound 2023-08-29 12:30:19 -05:00
xattr.h