Commit graph

165 commits

Author SHA1 Message Date
Namjae Jeon
ab0b263b74 ksmbd: opencode to remove FP_INODE macro
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>
2021-06-29 15:07:48 +09:00
Namjae Jeon
493fa2fbe4 ksmbd: fix dentry racy with rename()
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>
2021-06-29 15:07:44 +09:00
Marios Makassikis
a5a25a114a ksmbd: Relax credit_charge check in smb2_validate_credit_charge()
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>
2021-06-29 15:06:23 +09:00
Namjae Jeon
e294f78d34 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>
2021-06-29 15:06:08 +09:00
Namjae Jeon
8a893315dc ksmbd: replace request and respone buffer macro with inline functions
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>
2021-06-29 15:06:03 +09:00
Namjae Jeon
02d4b4aa6d ksmbd: replace SMB_DIRECT_TRANS macro with inline function
replace SMB_DIRECT_TRANS macro with inline function.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-06-29 15:05:59 +09:00
Hyunchul Lee
d8fb29980c ksmbd: remove and replace macros with inline functions in smb_common.h
Remove and replace macros with inline functions
in smb_common.h

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>
2021-06-29 15:05:54 +09:00
Hyunchul Lee
d4075abbc6 ksmbd: remove getting worker state macros
Remove getting worker state macros

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>
2021-06-29 15:05:50 +09:00
Hyunchul Lee
cb5b047f8e ksmbd: replace PAYLOAD_HEAD with inline function
Replace PAYLOAD_HEAD with inline function.

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>
2021-06-29 15:05:46 +09:00
Hyunchul Lee
c2220322b4 ksmbd: replace KSMBD_ALIGN with kernel ALIGN macro
Replace KSMBD_ALIGN with kernel ALIGN macro

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>
2021-06-29 15:05:42 +09:00
Hyunchul Lee
8ad8dc3421 ksmbd: replace BUFFER_NR_PAGES with inline function
Replace BUFFER_NR_PAGES with inline function

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>
2021-06-29 15:05:38 +09:00
Hyunchul Lee
b622948789 ksmbd: remove macros in transport_ipc.c
Remove macros in transport_ipc.c

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>
2021-06-29 15:05:34 +09:00
Hyunchul Lee
6c5e36d13e ksmbd: set MAY_* flags together with open flags
set MAY_* flags together with open flags and
remove ksmbd_vfs_inode_permission().

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>
2021-06-28 16:28:41 +09:00
Hyunchul Lee
333111a6dc ksmbd: factor out a ksmbd_vfs_lock_parent helper
Factor out a self-contained helper to
get stable parent dentry.

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>
2021-06-28 16:28:37 +09:00
Namjae Jeon
1a93084b9a ksmbd: move fs/cifsd to fs/ksmbd
Move fs/cifsd to fs/ksmbd and rename the remaining cifsd name to ksmbd.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
2021-06-28 16:28:31 +09:00