- 19 Jul, 2021 4 commits
-
-
Namjae Jeon authored
Move credit charge verification over smb2 request size verification to avoid being skipped. Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
MS-SMB2 specification describe : If the calculated credit number is greater than the CreditCharge, the server MUST fail the request with the error code STATUS_INVALID_PARAMETER. Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
When user insert wrong password, ksmbd return STATUS_INVALID_PARAMETER error status to client. It will make user confusing whether it is not password problem. This patch change error status to STATUS_LOGON_FAILURE. and return STATUS_INSUFFICIENT_RESOURCES if memory allocation failed on session setup. Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Use smb2_compression_ctx instead of smb2_encryption_neg_context. Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
- 15 Jul, 2021 1 commit
-
-
Namjae Jeon authored
Fix typo "openning" -> "opening". Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
- 13 Jul, 2021 5 commits
-
-
Hyunchul Lee authored
Fix an error message in ksmbd_conn_transport_init(). Signed-off-by:
Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Hyunchul Lee authored
set RDMA capability for FSCTL_QUERY_NETWORK_INTERFACE_INFO. Signed-off-by:
Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
CID 1502845 (#1 of 1): Unused value (UNUSED_VALUE) value_overwrite: Overwriting previous write to err with value from vfs_lock_file(filp, 0U, rlock, NULL). 6880 err = vfs_lock_file(filp, 0, rlock, NULL); 6881 if (err) 6882 pr_err("rollback unlock fail : %d\n", err); Reported-by:
Coverity Scan <scan-admin@coverity.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Add free acl.sd_buf and n.data on error handling in ksmbd_vfs_get_sd_xattr(). Reported-by:
Coverity Scan <scan-admin@coverity.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Coverity Scan seems to report false alarm. *** CID 1505930: (USE_AFTER_FREE) /fs/ksmbd/smb2pdu.c: 2527 in smb2_open() >>> CID 1505930: (USE_AFTER_FREE) >>> Passing freed pointer "context" as an argument to >>> "check_context_err". This patch remove unneeded check_context_err to make coverity scan happy. Reported-by:
Coverity Scan <scan-admin@coverity.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
- 10 Jul, 2021 7 commits
-
-
Hyunchul Lee authored
For code cleanup, handle error cases first in smb2_create_sd_buffers(). Reported-by:
Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Hyunchul Lee authored
instead of -ENOENT, make smb2_find_context_vals return NULL if the given context cannot be found. Reported-by:
Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Hyunchul Lee authored
the wait can be canceled by SMB2_CANCEL, SMB2_CLOSE, SMB2_LOGOFF, disconnection or shutdown, we don't have to use wait_event_interruptible. And this remove the warning from Coverity: CID 1502834 (#1 of 1): Unused value (UNUSED_VALUE) returned_value: Assigning value from ksmbd_vfs_posix_lock_wait(flock) to err here, but that stored value is overwritten before it can be used. Signed-off-by:
Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Hyunchul Lee authored
Append ksmbd_lock into the connection's lock list and the ksmbd_file's lock list. And when a file is closed, detach ksmbd_lock from these lists and free it. Signed-off-by:
Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Hyunchul Lee authored
decrement the count of running requests after sending the last response for multi-response requests. Signed-off-by:
Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Dan Carpenter authored
Simplify the code by using kasprintf(). This also silences a Smatch warning: fs/ksmbd/vfs.c:1725 ksmbd_vfs_xattr_stream_name() warn: inconsistent indenting Signed-off-by:
Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Dan Carpenter authored
These lines are intended one tab too far. Signed-off-by:
Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
- 08 Jul, 2021 5 commits
-
-
Namjae Jeon authored
This patch change data type of volatile/persistent id to u64 to make issue from idr_find and idr_remove(). !HAS_FILE_ID check will protect integer overflow issue from idr_find and idr_remove(). Reported-by:
Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Add two labels to fix memory leak in smb_inherit_dacl(). Reported-by:
Coverity Scan <scan-admin@coverity.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Add missing kfree(conv_name) on error path. Reported-by:
Coverity Scan <scan-admin@coverity.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
If st->status is not SMB_DIRECT_CS_CONNECTED, It will jump done label and accessing the uninitialized send_ctxi by smb_direct_flush_send_list will cause kernel oops. This patch just return -ENOTCONN to avoid it. Reported-by:
Coverity Scan <scan-admin@coverity.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
netdev can never be NULL in for_each_netdev loop. This patch remove unneeded NULL check. Reported-by:
Coverity Scan <scan-admin@coverity.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
- 06 Jul, 2021 1 commit
-
-
Colin Ian King authored
There is a error handling case that passes control to label out_err without pointer sess being assigned a value. The unassigned pointer may be any garbage value and so the test of rc < 0 && sess maybe true leading to sess being passed to the call to ksmbd_session_destroy. Fix this by setting sess to NULL in this corner case. Addresses-Coverity: ("Uninitialized pointer read") Signed-off-by:
Colin Ian King <colin.king@canonical.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
- 05 Jul, 2021 1 commit
-
-
Hyunchul Lee authored
Avoid calling mnt_user_ns() many time in a function. Cc: Christoph Hellwig <hch@infradead.org> Cc: Christian Brauner <christian@brauner.io> Signed-off-by:
Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
- 02 Jul, 2021 3 commits
-
-
Namjae Jeon authored
"ksmbd: remove macros in transport_ipc.c" commit change msg to req in ksmbd_rpc_ioctl/rap(). This will cause kernel oops when running smbclient -L test. Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Hyunchul Lee authored
For user namespace support, call vfs functions with struct user_namespace got from struct path. This patch have been tested mannually as below. Create an id-mapped mount using the mount-idmapped utility (https://github.com/brauner/mount-idmapped). $ mount-idmapped --map-mount b:1003:1002:1 /home/foo <EXPORT DIR>/foo (the user, "foo" is 1003, and the user "bar" is 1002). And mount the export directory using cifs with the user, "bar". succeed to create/delete/stat/read/write files and directory in the <EXPORT DIR>/foo. But fail with a bind mount for /home/foo. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Hyunchul Lee authored
For user namespace support, we need to pass struct user_namespace with struct dentry to some functions. For reducing the number of arguments, replace the struct dentry with struct path in these functions. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
- 30 Jun, 2021 6 commits
-
-
Namjae Jeon authored
Reorder and document on-disk and netlink structures in headers. This is a userspace ABI to communicate data between ksmbd and user IPC daemon using netlink. This is added to track and cache user account DB and share configuration info from userspace. - KSMBD_EVENT_HEARTBEAT_REQUEST(ksmbd_heartbeat) This event is to check whether user IPC daemon is alive. If user IPC daemon is dead, ksmbd keep existing connection till disconnecting and new connection will be denied. - KSMBD_EVENT_STARTING_UP(ksmbd_startup_request) This event is to receive the information that initializes the ksmbd server from the user IPC daemon and to start the server. The global section parameters are given from smb.conf as initialization information. - KSMBD_EVENT_SHUTTING_DOWN(ksmbd_shutdown_request) This event is to shutdown ksmbd server. - KSMBD_EVENT_LOGIN_REQUEST/RESPONSE(ksmbd_login_request/response) This event is to get user account info to user IPC daemon. - KSMBD_EVENT_SHARE_CONFIG_REQUEST/RESPONSE (ksmbd_share_config_request/response) This event is to get net share configuration info. - KSMBD_EVENT_TREE_CONNECT_REQUEST/RESPONSE (ksmbd_tree_connect_request/response) This event is to get session and tree connect info. - KSMBD_EVENT_TREE_DISCONNECT_REQUEST(ksmbd_tree_disconnect_request) This event is to send tree disconnect info to user IPC daemon. - KSMBD_EVENT_LOGOUT_REQUEST(ksmbd_logout_request) This event is to send logout request to user IPC daemon. - KSMBD_EVENT_RPC_REQUEST/RESPONSE(ksmbd_rpc_command) This event is to make DCE/RPC request like srvsvc, wkssvc, lsarpc, samr to be processed in userspace. - KSMBD_EVENT_SPNEGO_AUTHEN_REQUEST/RESPONSE (ksmbd_spnego_authen_request/response) This event is to make kerberos authentication to be processed in userspace. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Change server config string index to enumeration. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Change server state type macro to enumeration. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Change sid types to enumeration. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Change ACE types to enumeration. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
ksmbd does not support SMB1. This patch remove SMB1 oplock level macros. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
- 29 Jun, 2021 7 commits
-
-
Namjae Jeon authored
Opencode to remove ATTR_FP macro. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Use ksmbd_vfs_lock_parent to get stable parent dentry and remove PARENT_INODE macro. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Opencode to remove FP_INODE macro. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
Using ->d_name can be broken due to races with rename(). So use %pd with ->d_name to print filename and In other cases, use it under ->d_lock. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Marios Makassikis authored
smb2_validate_credit_charge() checks the CreditCharge field in the request is valid with regards to the payload size. The current implementation rejects requests with CreditCharge = 0 and a payload < 64K, even though they should be accepted. Set CreditCharge to a minimum value of 1 to avoid rejecting such requests. This matches what samba4 does. Fixes share enumeration for jcifs-ng clients. Signed-off-by:
Marios Makassikis <mmakassikis@freebox.fr> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
ksmbd: allow PROTECTED_DACL_SECINFO and UNPROTECTED_DACL_SECINFO addition information in smb2 set info security "cifsd: Fix regression in smb2_get_info" patch cause that dacl doesn't work. windows send smb2 set info security with PROTECTED_DACL_SECINFO to control dacl. But previous patch doesn't allow it. This patch add PROTECTED_DACL_SECINFO and UNPROTECTED_DACL_SECINFO addtional information flags in check. Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-
Namjae Jeon authored
replace request and respone buffer macro with inline functions. Reviewed-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by:
Steve French <stfrench@microsoft.com>
-