<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/smb/server/mgmt, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-09-18T17:25:09Z</updated>
<entry>
<title>ksmbd: override fsids for share path check</title>
<updated>2024-09-18T17:25:09Z</updated>
<author>
<name>Namjae Jeon</name>
</author>
<published>2024-08-04T23:56:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=08f9f96d430e08882004bcf03b778defbd1c16f8'/>
<id>urn:sha1:08f9f96d430e08882004bcf03b778defbd1c16f8</id>
<content type='text'>
[ Upstream commit a018c1b636e79b60149b41151ded7c2606d8606e ]

Sangsoo reported that a DAC denial error occurred when accessing
files through the ksmbd thread. This patch override fsids for share
path check.

Reported-by: Sangsoo Lee &lt;constant.lee@samsung.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ksmbd: fix race condition between destroy_previous_session() and smb2 operations()</title>
<updated>2024-08-29T15:36:13Z</updated>
<author>
<name>Namjae Jeon</name>
</author>
<published>2024-08-27T00:27:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c1e55020534c4aafbc38d8f5c4583ff30755ac18'/>
<id>urn:sha1:c1e55020534c4aafbc38d8f5c4583ff30755ac18</id>
<content type='text'>
[ Upstream commit 76e98a158b207771a6c9a0de0a60522a446a3447 ]

If there is -&gt;PreviousSessionId field in the session setup request,
The session of the previous connection should be destroyed.
During this, if the smb2 operation requests in the previous session are
being processed, a racy issue could happen with ksmbd_destroy_file_table().
This patch sets conn-&gt;status to KSMBD_SESS_NEED_RECONNECT to block
incoming  operations and waits until on-going operations are complete
(i.e. idle) before desctorying the previous session.

Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
Cc: stable@vger.kernel.org # v6.6+
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-25040
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ksmbd: ignore trailing slashes in share paths</title>
<updated>2024-05-22T23:26:29Z</updated>
<author>
<name>Nandor Kracser</name>
</author>
<published>2024-05-21T13:56:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=405ee4097c4bc3e70556520aed5ba52a511c2266'/>
<id>urn:sha1:405ee4097c4bc3e70556520aed5ba52a511c2266</id>
<content type='text'>
Trailing slashes in share paths (like: /home/me/Share/) caused permission
issues with shares for clients on iOS and on Android TV for me,
but otherwise they work fine with plain old Samba.

Cc: stable@vger.kernel.org
Signed-off-by: Nandor Kracser &lt;bonifaido@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: validate payload size in ipc response</title>
<updated>2024-04-02T14:21:01Z</updated>
<author>
<name>Namjae Jeon</name>
</author>
<published>2024-03-31T12:59:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a677ebd8ca2f2632ccdecbad7b87641274e15aac'/>
<id>urn:sha1:a677ebd8ca2f2632ccdecbad7b87641274e15aac</id>
<content type='text'>
If installing malicious ksmbd-tools, ksmbd.mountd can return invalid ipc
response to ksmbd kernel server. ksmbd should validate payload size of
ipc response from ksmbd.mountd to avoid memory overrun or
slab-out-of-bounds. This patch validate 3 ipc response that has payload.

Cc: stable@vger.kernel.org
Reported-by: Chao Ma &lt;machao2019@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: add support for durable handles v1/v2</title>
<updated>2024-03-12T05:36:39Z</updated>
<author>
<name>Namjae Jeon</name>
</author>
<published>2024-03-12T05:05:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c8efcc786146a951091588e5fa7e3c754850cb3c'/>
<id>urn:sha1:c8efcc786146a951091588e5fa7e3c754850cb3c</id>
<content type='text'>
Durable file handles allow reopening a file preserved on a short
network outage and transparent client reconnection within a timeout.
i.e. Durable handles aren't necessarily cleaned up when the opening
process terminates.

This patch add support for durable handle version 1 and 2.

To prove durable handles work on ksmbd, I have tested this patch with
the following smbtorture tests:

smb2.durable-open.open-oplock
smb2.durable-open.open-lease
smb2.durable-open.reopen1
smb2.durable-open.reopen1a
smb2.durable-open.reopen1a-lease
smb2.durable-open.reopen2
smb2.durable-open.reopen2a
smb2.durable-open.reopen2-lease
smb2.durable-open.reopen2-lease-v2
smb2.durable-open.reopen3
smb2.durable-open.reopen4
smb2.durable-open.delete_on_close2
smb2.durable-open.file-position
smb2.durable-open.lease
smb2.durable-open.alloc-size
smb2.durable-open.read-only
smb2.durable-v2-open.create-blob
smb2.durable-v2-open.open-oplock
smb2.durable-v2-open.open-lease
smb2.durable-v2-open.reopen1
smb2.durable-v2-open.reopen1a
smb2.durable-v2-open.reopen1a-lease
smb2.durable-v2-open.reopen2
smb2.durable-v2-open.reopen2b

Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: mark SMB2_SESSION_EXPIRED to session when destroying previous session</title>
<updated>2024-03-12T05:36:39Z</updated>
<author>
<name>Namjae Jeon</name>
</author>
<published>2024-03-10T10:30:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa9415d4024fd0c58d24a4ad4f1826fb8bfcc4aa'/>
<id>urn:sha1:fa9415d4024fd0c58d24a4ad4f1826fb8bfcc4aa</id>
<content type='text'>
Currently ksmbd exit connection as well destroying previous session.
When testing durable handle feaure, I found that
destroy_previous_session() should destroy only session, i.e. the
connection should be still alive. This patch mark SMB2_SESSION_EXPIRED
on the previous session to be destroyed later and not used anymore.

Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: Remove usage of the deprecated ida_simple_xx() API</title>
<updated>2024-01-09T18:52:33Z</updated>
<author>
<name>Christophe JAILLET</name>
</author>
<published>2023-12-14T20:50:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ebfee7ad2722f84064d241b5319a7085b881b584'/>
<id>urn:sha1:ebfee7ad2722f84064d241b5319a7085b881b584</id>
<content type='text'>
ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Note that the upper limit of ida_simple_get() is exclusive, but the one of
ida_alloc_range() is inclusive. So change a 0xFFFFFFFF into a 0xFFFFFFFE in
order to keep the same behavior.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&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: Remove unused field in ksmbd_user struct</title>
<updated>2023-10-23T00:06:27Z</updated>
<author>
<name>Cheng-Han Wu</name>
</author>
<published>2023-10-02T05:32:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eacc655e18d1dec9b50660d16a1ddeeb4d6c48f2'/>
<id>urn:sha1:eacc655e18d1dec9b50660d16a1ddeeb4d6c48f2</id>
<content type='text'>
fs/smb/server/mgmt/user_config.h:21: Remove the unused field 'failed_login_count' from the ksmbd_user struct.

Signed-off-by: Cheng-Han Wu &lt;hank20010209@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 race condition between tree conn lookup and disconnect</title>
<updated>2023-10-05T02:56:28Z</updated>
<author>
<name>Namjae Jeon</name>
</author>
<published>2023-10-05T02:22:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=33b235a6e6ebe0f05f3586a71e8d281d00f71e2e'/>
<id>urn:sha1:33b235a6e6ebe0f05f3586a71e8d281d00f71e2e</id>
<content type='text'>
if thread A in smb2_write is using work-tcon, other thread B use
smb2_tree_disconnect free the tcon, then thread A will use free'd tcon.

                            Time
                             +
 Thread A                    | Thread A
 smb2_write                  | smb2_tree_disconnect
                             |
                             |
                             |   kfree(tree_conn)
                             |
  // UAF!                    |
  work-&gt;tcon-&gt;share_conf     |
                             +

This patch add state, reference count and lock for tree conn to fix race
condition issue.

Reported-by: luosili &lt;rootlab@huawei.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ksmbd: fix race condition between session lookup and expire</title>
<updated>2023-10-05T01:21:48Z</updated>
<author>
<name>Namjae Jeon</name>
</author>
<published>2023-10-04T09:25:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=53ff5cf89142b978b1a5ca8dc4d4425e6a09745f'/>
<id>urn:sha1:53ff5cf89142b978b1a5ca8dc4d4425e6a09745f</id>
<content type='text'>
 Thread A                        +  Thread B
 ksmbd_session_lookup            |  smb2_sess_setup
   sess = xa_load                |
                                 |
                                 |    xa_erase(&amp;conn-&gt;sessions, sess-&gt;id);
                                 |
                                 |    ksmbd_session_destroy(sess) --&gt; kfree(sess)
                                 |
   // UAF!                       |
   sess-&gt;last_active = jiffies   |
                                 +

This patch add rwsem to fix race condition between ksmbd_session_lookup
and ksmbd_expire_session.

Reported-by: luosili &lt;rootlab@huawei.com&gt;
Signed-off-by: Namjae Jeon &lt;linkinjeon@kernel.org&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
</feed>
