- 16 11月, 2022 40 次提交
-
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.17-rc1 commit a58b45a4 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/a58b45a4dbfd ------------------------------- Set RSS capable in FSCTL_QUERY_NETWORK_INTERFACE_INFO if netdev has multi tx queues. And add ksmbd_compare_user() to avoid racy condition issue in ksmbd_free_user(). because windows client is simultaneously used to send session setup requests for multichannel connection. Tested-by: NZiwei Xie <zw.xie@high-flyer.cn> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Marios Makassikis 提交于
mainline inclusion from mainline-5.17-rc1 commit 80917f17 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/80917f17e3f9 ------------------------------- The 'share' parameter is no longer used by smb2_get_name() since commit 265fd199 ("ksmbd: use LOOKUP_BENEATH to prevent the out of share access"). Acked-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NMarios Makassikis <mmakassikis@freebox.fr> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Marcos Del Sol Vives 提交于
mainline inclusion from mainline-5.16-rc7 commit 83912d6d category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/83912d6d55be ------------------------------- According to the official Microsoft MS-SMB2 document section 3.3.5.4, this flag should be used only for 3.0 and 3.0.2 dialects. Setting it for 3.1.1 is a violation of the specification. This causes my Windows 10 client to detect an anomaly in the negotiation, and disable encryption entirely despite being explicitly enabled in ksmbd, causing all data transfers to go in plain text. Fixes: e2f34481 ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org # v5.15 Acked-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NMarcos Del Sol Vives <marcos@orca.pet> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.16-rc7 commit f2e78aff category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/f2e78affc48d ------------------------------- No check for if "rc" is an error code for build_sec_desc(). This can cause problems with using uninitialized pntsd_size. Fixes: e2f34481 ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org # v5.15 Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc1 commit 777cad16 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/777cad1604d6 ------------------------------- ksmbd is forcing to turn on FS_POSIX_ACL in Kconfig to use vfs acl functions(posix_acl_alloc, get_acl, set_posix_acl). OpenWRT and other platform doesn't use acl and this config is disable by default in kernel. This patch use IS_ENABLED() to know acl config is enable and use acl function if it is enable. Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.16-rc3 commit 178ca6f8 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/178ca6f85aa3 ------------------------------- Fix memleak in get_file_stream_info() Fixes: 34061d6b ("ksmbd: validate OutputBufferLength of QUERY_DIR, QUERY_INFO, IOCTL requests") Cc: stable@vger.kernel.org # v5.15 Reported-by: NCoverity Scan <scan-admin@coverity.com> Acked-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.16-rc3 commit 1ec72153 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/1ec72153ff43 ------------------------------- If xattr is not supported like exfat or fat, ksmbd server doesn't contain default data stream in FILE_STREAM_INFORMATION response. It will cause ppt or doc file update issue if local filesystem is such as ones. This patch move goto statement to contain it. Fixes: 9f632331 ("ksmbd: add default data stream name in FILE_STREAM_INFORMATION") Cc: stable@vger.kernel.org # v5.15 Acked-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.16-rc3 commit 8e537d14 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/8e537d1465e7 ------------------------------- While file transfer through windows client, This error flood message happen. This flood message will cause performance degradation and misunderstand server has problem. Fixes: e294f78d ("ksmbd: allow PROTECTED_DACL_SECINFO and UNPROTECTED_DACL_SECINFO addition information in smb2 set info security") Cc: stable@vger.kernel.org # v5.15 Acked-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Christophe JAILLET 提交于
mainline inclusion from mainline-5.16-rc3 commit f8fbfd85 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/f8fbfd85f5c9 ------------------------------- All the error handling paths of 'smb2_sess_setup()' end to 'out_err'. All but the new error handling path added by the commit given in the Fixes tag below. Fix this error handling path and branch to 'out_err' as well. Fixes: 0d994cd4 ("ksmbd: add buffer validation in session setup") Cc: stable@vger.kernel.org # v5.15 Acked-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.16-rc1 commit 2dd9129f category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/2dd9129f7dec ------------------------------- To move smb2_transform_hdr to smbfs_common, This patch remove smb2_buf_length variable in smb2_transform_hdr. Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.16-rc1 commit cb451720 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/cb4517201b8a ------------------------------- To move smb2_hdr to smbfs_common, This patch remove smb2_buf_length variable in smb2_hdr. Also, declare smb2_get_msg function to get smb2 request/response from ->request/response_buf. Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Marios Makassikis 提交于
mainline inclusion from mainline-5.16-rc1 commit 78f1688a category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/78f1688a64cc ------------------------------- The validate_negotiate_info_req struct definition includes an extra field to access the data coming after the header. This causes the check in fsctl_validate_negotiate_info() to count the first element of the array twice. This in turn makes some valid requests fail, depending on whether they include padding or not. Fixes: f7db8fd0 ("ksmbd: add validation in smb2_ioctl") Cc: stable@vger.kernel.org # v5.15 Acked-by: NNamjae Jeon <linkinjeon@kernel.org> Acked-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NMarios Makassikis <mmakassikis@freebox.fr> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Ralph Boehme 提交于
mainline inclusion from mainline-5.16-rc1 commit 341b1601 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/341b16014bf8 ------------------------------- Use cmd helper variable in smb2_get_ksmbd_tcon(). Cc: Tom Talpey <tom@talpey.com> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Steve French <smfrench@gmail.com> Cc: Hyunchul Lee <hyc.lee@gmail.com> Acked-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NRalph Boehme <slow@samba.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Marios Makassikis 提交于
mainline inclusion from mainline-5.15-rc7 commit 0d994cd4 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/0d994cd482ee ------------------------------- Make sure the security buffer's length/offset are valid with regards to the packet length. Acked-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NMarios Makassikis <mmakassikis@freebox.fr> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc7 commit 621be84a category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/621be84a9d1f ------------------------------- To avoid dictionary attacks (repeated session setups rapidly sent) to connect to server, ksmbd make a delay of a 5 seconds on session setup failure to make it harder to send enough random connection requests to break into a server if a user insert the wrong password 10 times in a row. Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Hyunchul Lee 提交于
mainline inclusion from mainline-5.15-rc7 commit 34061d6b category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/34061d6b76a4 ------------------------------- Validate OutputBufferLength of QUERY_DIR, QUERY_INFO, IOCTL requests and check the free size of response buffer for these requests. Acked-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc7 commit 4bc59477 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/4bc59477c329 ------------------------------- ksmbd limit read/write/trans buffer size not to exceed maximum 8MB. And set the minimum value of max response buffer size to 64KB. Windows client doesn't send session setup request if ksmbd set max trans/read/write size lower than 64KB in smb2 negotiate. It means windows allow at least 64 KB or more about this value. Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc7 commit dbad6300 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/dbad63001eac ------------------------------- Add the check to validate compound response buffer. Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc7 commit 9a63b999 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/9a63b999ae54 ------------------------------- DataOffset and Length validation can be potencial 32bit overflow. This patch fix it. Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Hyunchul Lee 提交于
mainline inclusion from mainline-5.15-rc7 commit bf8acc9e category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/bf8acc9e10e2 ------------------------------- * Requests except READ, WRITE, IOCTL, INFO, QUERY DIRECOTRY, CANCEL must consume one credit. * If client's granted credits are insufficient, refuse to handle requests. * Windows server 2016 or later grant up to 8192 credits to clients at once. Acked-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc7 commit f7db8fd0 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/f7db8fd03a4b ------------------------------- Add validation for request/response buffer size check in smb2_ioctl and fsctl_copychunk() take copychunk_ioctl_req pointer and the other arguments instead of smb2_ioctl_req structure and remove an unused smb2_ioctl_req argument of fsctl_validate_negotiate_info. Cc: Tom Talpey <tom@talpey.com> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Böhme <slow@samba.org> Cc: Steve French <smfrench@gmail.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Acked-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc5 commit 64e78755 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/64e787556027 ------------------------------- Marios reported kernel oops from fuse driver when ksmbd call mark_inode_dirty(). This patch directly update ->i_ctime after removing mark_inode_ditry() and notify_change will put inode to dirty list. Cc: Tom Talpey <tom@talpey.com> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Böhme <slow@samba.org> Cc: Hyunchul Lee <hyc.lee@gmail.com> Reported-by: NMarios Makassikis <mmakassikis@freebox.fr> Tested-by: NMarios Makassikis <mmakassikis@freebox.fr> Acked-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc5 commit c7705eec category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/c7705eec78c9 ------------------------------- Tom suggested to use buf_data_size that is already calculated, to verify these offsets. Cc: Tom Talpey <tom@talpey.com> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Böhme <slow@samba.org> Suggested-by: NTom Talpey <tom@talpey.com> Acked-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc5 commit 51a13873 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/51a1387393d9 ------------------------------- Although ksmbd doesn't send SMB2.0 support in supported dialect list of smb negotiate response, There is the leftover of smb2.0 dialect. This patch remove it not to support SMB2.0 in ksmbd. Cc: Tom Talpey <tom@talpey.com> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Böhme <slow@samba.org> Cc: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc4 commit 4227f811 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/4227f811cdeb ------------------------------- Validate that the transform and smb request headers are present before checking OriginalMessageSize and SessionId fields. Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Böhme <slow@samba.org> Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Reviewed-by: NTom Talpey <tom@talpey.com> Acked-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Hyunchul Lee 提交于
mainline inclusion from mainline-5.15-rc4 commit 8f77150c category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/8f77150c15f8 ------------------------------- Add buffer validation for SMB2_CREATE_CONTEXT. Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Reviewed-by: NRalph Boehme <slow@samba.org> Signed-off-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc4 commit 442ff9eb category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/442ff9ebeb01 ------------------------------- This patch add validation to check request buffer check in smb2 negotiate and fix null pointer deferencing oops in smb3_preauth_hash_rsp() that found from manual test. Cc: Tom Talpey <tom@talpey.com> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Böhme <slow@samba.org> Cc: Hyunchul Lee <hyc.lee@gmail.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Reviewed-by: NRalph Boehme <slow@samba.org> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc4 commit 9496e268 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/9496e268e3af ------------------------------- Add buffer validation in smb2_set_info, and remove unused variable in set_file_basic_info. and smb2_set_info infolevel functions take structure pointer argument. Cc: Tom Talpey <tom@talpey.com> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Böhme <slow@samba.org> Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Acked-by: NHyunchul Lee <hyc.lee@gmail.com> Reviewed-by: NRalph Boehme <slow@samba.org> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc4 commit 88d30052 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/88d300522cbb ------------------------------- Use correct basic info level in set/get_file_basic_info(). Reviewed-by: NRalph Boehme <slow@samba.org> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc4 commit d72a9c15 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/d72a9c158893 ------------------------------- Ronnie reported invalid request buffer access in chained command when inserting garbage value to NextCommand of compound request. This patch add validation check to avoid this issue. Cc: Tom Talpey <tom@talpey.com> Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Böhme <slow@samba.org> Tested-by: NSteve French <smfrench@gmail.com> Reviewed-by: NSteve French <smfrench@gmail.com> Acked-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Hyunchul Lee 提交于
mainline inclusion from mainline-5.15-rc3 commit 265fd199 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/265fd1991c1d ------------------------------- instead of removing '..' in a given path, call kern_path with LOOKUP_BENEATH flag to prevent the out of share access. ran various test on this: smb2-cat-async smb://127.0.0.1/homes/../out_of_share smb2-cat-async smb://127.0.0.1/homes/foo/../../out_of_share smbclient //127.0.0.1/homes -c "mkdir ../foo2" smbclient //127.0.0.1/homes -c "rename bar ../bar" Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Boehme <slow@samba.org> Tested-by: NSteve French <smfrench@gmail.com> Tested-by: NNamjae Jeon <linkinjeon@kernel.org> Acked-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc3 commit 4ea47798 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/4ea477988c42 ------------------------------- Use LOOKUP_NO_SYMLINKS flags for default lookup to prohibit the middle of symlink component lookup and remove follow symlinks parameter support. We re-implement it as reparse point later. Test result: smbclient -Ulinkinjeon%1234 //172.30.1.42/share -c "get hacked/passwd passwd" NT_STATUS_OBJECT_NAME_NOT_FOUND opening remote file \hacked\passwd Cc: Ralph Böhme <slow@samba.org> Cc: Steve French <smfrench@gmail.com> Acked-by: NRonnie Sahlberg <lsahlber@redhat.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc3 commit 18a015bc category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/18a015bccf9e ------------------------------- When second smb2 pdu has invalid protocol id, ksmbd doesn't detect it and allow to process smb2 request. This patch add the check it in ksmbd_verify_smb_message() and don't use protocol id of smb2 request as protocol id of response. Reviewed-by: NRonnie Sahlberg <ronniesahlberg@gmail.com> Reviewed-by: NRalph Böhme <slow@samba.org> Reported-by: NRonnie Sahlberg <lsahlber@redhat.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc3 commit 9f632331 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/9f6323311c70 ------------------------------- Windows client expect to get default stream name(::DATA) in FILE_STREAM_INFORMATION response even if there is no stream data in file. This patch fix update failure when writing ppt or doc files. Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Reviewed-By: NTom Talpey <tom@talpey.com> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc3 commit 6d56262c category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/6d56262c3d22 ------------------------------- Add validation to check whether req->InputBufferLength is smaller than smb2_ea_info_req structure size. Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com> Cc: Ralph Böhme <slow@samba.org> Cc: Steve French <smfrench@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Hyunchul Lee 提交于
mainline inclusion from mainline-5.15-rc3 commit f58eae6c category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/f58eae6c5fa8 ------------------------------- Because of .., files outside the share directory could be accessed. To prevent this, normalize the given path and remove all . and .. components. In addition to the usual large set of regression tests (smbtorture and xfstests), ran various tests on this to specifically check path name validation including libsmb2 tests to verify path normalization: ./examples/smb2-ls-async smb://172.30.1.15/homes2/../ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/../ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/../../ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/../ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/..bar/ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/bar../ ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/bar.. ./examples/smb2-ls-async smb://172.30.1.15/homes2/foo/bar../../../../Signed-off-by: NHyunchul Lee <hyc.lee@gmail.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Namjae Jeon 提交于
mainline inclusion from mainline-5.15-rc1 commit 4ffd5264 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/4ffd5264e8ec ------------------------------- Addresses-Coverity reported Uninitialized variables warninig : /fs/ksmbd/smb2pdu.c: 5525 in set_file_basic_info() 5519 if (!rc) { 5520 inode->i_ctime = ctime; 5521 mark_inode_dirty(inode); 5522 } 5523 inode_unlock(inode); 5524 } >>> CID 1506805: Uninitialized variables (UNINIT) >>> Using uninitialized value "rc". 5525 return rc; 5526 } 5527 5528 static int set_file_allocation_info(struct ksmbd_work *work, 5529 struct ksmbd_file *fp, char *buf) 5530 { Addresses-Coverity: ("Uninitialized variable") Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Per Forlin 提交于
mainline inclusion from mainline-5.15-rc1 commit d475866e category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/d475866eeed8 ------------------------------- This log happens on servers with a network bridge since the bridge does not have a specified link speed. This is not a real error so change the error log to debug instead. Signed-off-by: NPer Forlin <perfn@axis.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Christian Brauner 提交于
mainline inclusion from mainline-5.15-rc1 commit db7fb6fe category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/db7fb6fe3d7a ------------------------------- Permission checking and copying over ownership information is the task of the underlying filesystem not ksmbd. The order is also wrong here. This modifies the inode before notify_change(). If notify_change() fails this will have changed ownership nonetheless. All of this is unnecessary though since the underlying filesystem's ->setattr handler will do all this (if required) by itself. Cc: Steve French <stfrench@microsoft.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Namjae Jeon <namjae.jeon@samsung.com> Cc: Hyunchul Lee <hyc.lee@gmail.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Cc: linux-cifs@vger.kernel.org Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-
由 Christian Brauner 提交于
mainline inclusion from mainline-5.15-rc1 commit eb5784f0 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA Reference: https://git.kernel.org/torvalds/linux/c/eb5784f0c6ef ------------------------------- It seems the error was accidently ignored until now. Make sure it is surfaced. Cc: Steve French <stfrench@microsoft.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: Namjae Jeon <namjae.jeon@samsung.com> Cc: Hyunchul Lee <hyc.lee@gmail.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org> Cc: linux-cifs@vger.kernel.org Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com> Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org> Signed-off-by: NSteve French <stfrench@microsoft.com> Signed-off-by: NJason Yan <yanaijie@huawei.com> Signed-off-by: NZhong Jinghua <zhongjinghua@huawei.com>
-