<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/fs/ksmbd, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/fs/ksmbd?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/fs/ksmbd?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-10-07T15:19:26Z</updated>
<entry>
<title>Merge tag '6.1-rc-ksmbd-fixes' of git://git.samba.org/ksmbd</title>
<updated>2022-10-07T15:19:26Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-10-07T15:19:26Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9f4b9beeb9cf46c4b172fca06de5bd6831108641'/>
<id>urn:sha1:9f4b9beeb9cf46c4b172fca06de5bd6831108641</id>
<content type='text'>
Pull ksmbd updates from Steve French:

 - RDMA (smbdirect) fixes

 - fixes for SMB3.1.1 POSIX Extensions (especially for id mapping)

 - various casemapping fixes for mount and lookup

 - UID mapping fixes

 - fix confusing error message

 - protocol negotiation fixes, including NTLMSSP fix

 - two encryption fixes

 - directory listing fix

 - some cleanup fixes

* tag '6.1-rc-ksmbd-fixes' of git://git.samba.org/ksmbd: (24 commits)
  ksmbd: validate share name from share config response
  ksmbd: call ib_drain_qp when disconnected
  ksmbd: make utf-8 file name comparison work in __caseless_lookup()
  ksmbd: Fix user namespace mapping
  ksmbd: hide socket error message when ipv6 config is disable
  ksmbd: reduce server smbdirect max send/receive segment sizes
  ksmbd: decrease the number of SMB3 smbdirect server SGEs
  ksmbd: Fix wrong return value and message length check in smb2_ioctl()
  ksmbd: set NTLMSSP_NEGOTIATE_SEAL flag to challenge blob
  ksmbd: fix encryption failure issue for session logoff response
  ksmbd: fix endless loop when encryption for response fails
  ksmbd: fill sids in SMB_FIND_FILE_POSIX_INFO response
  ksmbd: set file permission mode to match Samba server posix extension behavior
  ksmbd: change security id to the one samba used for posix extension
  ksmbd: update documentation
  ksmbd: casefold utf-8 share names and fix ascii lowercase conversion
  ksmbd: port to vfs{g,u}id_t and associated helpers
  ksmbd: fix incorrect handling of iterate_dir
  MAINTAINERS: remove Hyunchul Lee from ksmbd maintainers
  MAINTAINERS: Add Tom Talpey as ksmbd reviewer
  ...
</content>
</entry>
<entry>
<title>Merge tag 'pull-file' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2022-10-07T00:13:18Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2022-10-07T00:13:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7a3353c5c441175582cf0d17f855b2ffd83fb9db'/>
<id>urn:sha1:7a3353c5c441175582cf0d17f855b2ffd83fb9db</id>
<content type='text'>
Pull vfs file updates from Al Viro:
 "struct file-related stuff"

* tag 'pull-file' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  dma_buf_getfile(): don't bother with -&gt;f_flags reassignments
  Change calling conventions for filldir_t
  locks: fix TOCTOU race when granting write lease
</content>
</entry>
<entry>
<title>ksmbd: validate share name from share config response</title>
<updated>2022-10-05T06:15:44Z</updated>
<author>
<name>Atte Heikkilä</name>
<email>atteh.mailbox@gmail.com</email>
</author>
<published>2022-10-02T23:09:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f5ba1cdaf5eb380e148183bda06d4844b457d095'/>
<id>urn:sha1:f5ba1cdaf5eb380e148183bda06d4844b457d095</id>
<content type='text'>
Share config response may contain the share name without casefolding as
it is known to the user space daemon. When it is present, casefold and
compare it to the share name the share config request was made with. If
they differ, we have a share config which is incompatible with the way
share config caching is done. This is the case when CONFIG_UNICODE is
not set, the share name contains non-ASCII characters, and those non-
ASCII characters do not match those in the share name known to user
space. In other words, when CONFIG_UNICODE is not set, UTF-8 share
names now work but are only case-insensitive in the ASCII range.

Signed-off-by: Atte Heikkilä &lt;atteh.mailbox@gmail.com&gt;
Acked-by: Tom Talpey &lt;tom@talpey.com&gt;
Acked-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: call ib_drain_qp when disconnected</title>
<updated>2022-10-05T06:15:44Z</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@kernel.org</email>
</author>
<published>2022-10-02T00:38:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=141fa9824c0fc11d44b2d5bb1266a33e95fa67fd'/>
<id>urn:sha1:141fa9824c0fc11d44b2d5bb1266a33e95fa67fd</id>
<content type='text'>
When disconnected, call ib_drain_qp to cancel all pending work requests
and prevent ksmbd_conn_handler_loop from waiting for a long time
for those work requests to compelete.

Signed-off-by: Hyunchul Lee &lt;hyc.lee@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Reviewed-by: Tom Talpey &lt;tom@talpey.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: make utf-8 file name comparison work in __caseless_lookup()</title>
<updated>2022-10-05T06:15:44Z</updated>
<author>
<name>Atte Heikkilä</name>
<email>atteh.mailbox@gmail.com</email>
</author>
<published>2022-09-27T21:57:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=dbab80e2071ad8c702e50dab43326608a127d27b'/>
<id>urn:sha1:dbab80e2071ad8c702e50dab43326608a127d27b</id>
<content type='text'>
Case-insensitive file name lookups with __caseless_lookup() use
strncasecmp() for file name comparison. strncasecmp() assumes an
ISO8859-1-compatible encoding, which is not the case here as UTF-8
is always used. As such, use of strncasecmp() here produces correct
results only if both strings use characters in the ASCII range only.
Fix this by using utf8_strncasecmp() if CONFIG_UNICODE is set. On
failure or if CONFIG_UNICODE is not set, fallback to strncasecmp().
Also, as we are adding an include for `linux/unicode.h', include it
in `fs/ksmbd/connection.h' as well since it should be explicit there.

Signed-off-by: Atte Heikkilä &lt;atteh.mailbox@gmail.com&gt;
Acked-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: Fix user namespace mapping</title>
<updated>2022-10-05T06:15:44Z</updated>
<author>
<name>Mickaël Salaün</name>
<email>mic@digikod.net</email>
</author>
<published>2022-09-29T10:04:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=7c88c1e0ab1704bacb751341ee6431c3be34b834'/>
<id>urn:sha1:7c88c1e0ab1704bacb751341ee6431c3be34b834</id>
<content type='text'>
A kernel daemon should not rely on the current thread, which is unknown
and might be malicious.  Before this security fix,
ksmbd_override_fsids() didn't correctly override FS UID/GID which means
that arbitrary user space threads could trick the kernel to impersonate
arbitrary users or groups for file system access checks, leading to
file system access bypass.

This was found while investigating truncate support for Landlock:
https://lore.kernel.org/r/CAKYAXd8fpMJ7guizOjHgxEyyjoUwPsx3jLOPZP=wPYcbhkVXqA@mail.gmail.com

Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: Hyunchul Lee &lt;hyc.lee@gmail.com&gt;
Cc: Steve French &lt;smfrench@gmail.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Mickaël Salaün &lt;mic@digikod.net&gt;
Link: https://lore.kernel.org/r/20220929100447.108468-1-mic@digikod.net
Acked-by: Christian Brauner (Microsoft) &lt;brauner@kernel.org&gt;
Acked-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: hide socket error message when ipv6 config is disable</title>
<updated>2022-10-05T06:15:44Z</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@kernel.org</email>
</author>
<published>2022-09-27T12:21:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5876e99611a91dfb2fb1f7af9d1ae5c017c8331c'/>
<id>urn:sha1:5876e99611a91dfb2fb1f7af9d1ae5c017c8331c</id>
<content type='text'>
When ipv6 config is disable(CONFIG_IPV6 is not set), ksmbd fallback to
create ipv4 socket. User reported that this error message lead to
misunderstood some issue. Users have requested not to print this error
message that occurs even though there is no problem.

Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Acked-by: Tom Talpey &lt;tom@talpey.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: reduce server smbdirect max send/receive segment sizes</title>
<updated>2022-10-05T06:15:44Z</updated>
<author>
<name>Tom Talpey</name>
<email>tom@talpey.com</email>
</author>
<published>2022-09-23T21:53:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=78af146e109bef5b3c411964141c6f8adbccd3b0'/>
<id>urn:sha1:78af146e109bef5b3c411964141c6f8adbccd3b0</id>
<content type='text'>
Reduce ksmbd smbdirect max segment send and receive size to 1364
to match protocol norms. Larger buffers are unnecessary and add
significant memory overhead.

Signed-off-by: Tom Talpey &lt;tom@talpey.com&gt;
Acked-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: decrease the number of SMB3 smbdirect server SGEs</title>
<updated>2022-10-05T06:15:44Z</updated>
<author>
<name>Tom Talpey</name>
<email>tom@talpey.com</email>
</author>
<published>2022-09-23T21:53:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2b4eeeaa90617c5e37da7c804c422b4e833b87b2'/>
<id>urn:sha1:2b4eeeaa90617c5e37da7c804c422b4e833b87b2</id>
<content type='text'>
The server-side SMBDirect layer requires no more than 6 send SGEs
The previous default of 8 causes ksmbd to fail on the SoftiWARP
(siw) provider, and possibly others. Additionally, large numbers
of SGEs reduces performance significantly on adapter implementations.

Signed-off-by: Tom Talpey &lt;tom@talpey.com&gt;
Acked-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: Fix wrong return value and message length check in smb2_ioctl()</title>
<updated>2022-10-05T06:15:44Z</updated>
<author>
<name>Zhang Xiaoxu</name>
<email>zhangxiaoxu5@huawei.com</email>
</author>
<published>2022-09-26T03:36:30Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b1763d265af62800ec96eeb79803c4c537dcef3a'/>
<id>urn:sha1:b1763d265af62800ec96eeb79803c4c537dcef3a</id>
<content type='text'>
Commit c7803b05f74b ("smb3: fix ksmbd bigendian bug in oplock
break, and move its struct to smbfs_common") use the defination
of 'struct validate_negotiate_info_req' in smbfs_common, the
array length of 'Dialects' changed from 1 to 4, but the protocol
does not require the client to send all 4. This lead the request
which satisfied with protocol and server to fail.

So just ensure the request payload has the 'DialectCount' in
smb2_ioctl(), then fsctl_validate_negotiate_info() will use it
to validate the payload length and each dialect.

Also when the {in, out}_buf_len is less than the required, should
goto out to initialize the status in the response header.

Fixes: f7db8fd03a4b ("ksmbd: add validation in smb2_ioctl")
Cc: stable@vger.kernel.org
Signed-off-by: Zhang Xiaoxu &lt;zhangxiaoxu5@huawei.com&gt;
Acked-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
</feed>
