<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/cifs/readdir.c, branch linux-5.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-10-29T09:10:57Z</updated>
<entry>
<title>SMB3.1.1: Fix ids returned in POSIX query dir</title>
<updated>2020-10-29T09:10:57Z</updated>
<author>
<name>Steve French</name>
</author>
<published>2020-10-20T07:02:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d8e39c11f66125f49de55537a6efc8ecadf4a0f7'/>
<id>urn:sha1:d8e39c11f66125f49de55537a6efc8ecadf4a0f7</id>
<content type='text'>
commit 9934430e2178d5164eb1ac91a9b092f9e7e64745 upstream.

We were setting the uid/gid to the default in each dir entry
in the parsing of the POSIX query dir response, rather
than attempting to map the user and group SIDs returned by
the server to well known SIDs (or upcall if not found).

CC: Stable &lt;stable@vger.kernel.org&gt;
Reviewed-by: Aurelien Aptel &lt;aaptel@suse.com&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>cifs: Standardize logging output</title>
<updated>2020-06-01T05:10:18Z</updated>
<author>
<name>Joe Perches</name>
</author>
<published>2020-04-15T05:42:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a0a3036b81f1f66fa3333559ecfe18f5bbfa5076'/>
<id>urn:sha1:a0a3036b81f1f66fa3333559ecfe18f5bbfa5076</id>
<content type='text'>
Use pr_fmt to standardize all logging for fs/cifs.

Some logging output had no CIFS: specific prefix.

Now all output has one of three prefixes:

o CIFS:
o CIFS: VFS:
o Root-CIFS:

Miscellanea:

o Convert printks to pr_&lt;level&gt;
o Neaten macro definitions
o Remove embedded CIFS: prefixes from formats
o Convert "illegal" to "invalid"
o Coalesce formats
o Add missing '\n' format terminations
o Consolidate multiple cifs_dbg continuations into single calls
o More consistent use of upper case first word output logging
o Multiline statement argument alignment and wrapping

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>smb3: change noisy error message to FYI</title>
<updated>2020-04-09T18:28:24Z</updated>
<author>
<name>Steve French</name>
</author>
<published>2020-04-09T06:07:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1dc94b7381bd5f71aa417487abaf3bd3d70938c4'/>
<id>urn:sha1:1dc94b7381bd5f71aa417487abaf3bd3d70938c4</id>
<content type='text'>
The noisy posix error message in readdir was supposed
to be an FYI (not enabled by default)
  CIFS VFS: XXX dev 66306, reparse 0, mode 755

Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Reviewed-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
</content>
</entry>
<entry>
<title>cifs: plumb smb2 POSIX dir enumeration</title>
<updated>2020-03-23T03:49:09Z</updated>
<author>
<name>Aurelien Aptel</name>
</author>
<published>2020-02-08T14:50:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3d519bd1269f1f439db818e04252022ecffdef51'/>
<id>urn:sha1:3d519bd1269f1f439db818e04252022ecffdef51</id>
<content type='text'>
* add code to request POSIX info level
* parse dir entries and fill cifs_fattr to get correct inode data

since the POSIX payload is variable size the number of entries in a
FIND response needs to be computed differently.

Dirs and regular files are properly reported along with mode bits,
hardlink number, c/m/atime. No special files yet (see below).

Current experimental version of Samba with the extension unfortunately
has issues with wildcards and needs the following patch:

&gt; --- i/source3/smbd/smb2_query_directory.c
&gt; +++ w/source3/smbd/smb2_query_directory.c
&gt; @@ -397,9 +397,7 @@ smbd_smb2_query_directory_send(TALLOC_CTX
&gt; *mem_ctx,
&gt; 		}
&gt; 	}
&gt;
&gt; -       if (!state-&gt;smbreq-&gt;posix_pathnames) {
&gt; 		wcard_has_wild = ms_has_wild(state-&gt;in_file_name);
&gt; -       }
&gt;
&gt; 	/* Ensure we've canonicalized any search path if not a wildcard. */
&gt; 	if (!wcard_has_wild) {
&gt;

Also for special files despite reporting them as reparse point samba
doesn't set the reparse tag field. This patch will mark them as needing
re-evaluation but the re-evaluate code doesn't deal with it yet.

Signed-off-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: fix mode bits from dir listing when mounted with modefromsid</title>
<updated>2020-02-06T23:19:38Z</updated>
<author>
<name>Aurelien Aptel</name>
</author>
<published>2020-02-06T17:16:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3e056c35108661e418c803adfc054bf683426e7'/>
<id>urn:sha1:e3e056c35108661e418c803adfc054bf683426e7</id>
<content type='text'>
When mounting with -o modefromsid, the mode bits are stored in an
ACE. Directory enumeration (e.g. ls -l /mnt) triggers an SMB Query Dir
which does not include ACEs in its response. The mode bits in this
case are silently set to a default value of 755 instead.

This patch marks the dentry created during the directory enumeration
as needing re-evaluation (i.e. additional Query Info with ACEs) so
that the mode bits can be properly extracted.

Quick repro:

$ mount.cifs //win19.test/data /mnt -o ...,modefromsid
$ touch /mnt/foo &amp;&amp; chmod 751 /mnt/foo
$ stat /mnt/foo
  # reports 751 (OK)
$ sleep 2
  # dentry older than 1s by default get invalidated
$ ls -l /mnt
  # since dentry invalid, ls does a Query Dir
  # and reports foo as 755 (WRONG)

Signed-off-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
CC: Stable &lt;stable@vger.kernel.org&gt;
Reviewed-by: Pavel Shilovsky &lt;pshilov@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: Optimize readdir on reparse points</title>
<updated>2019-12-23T15:04:44Z</updated>
<author>
<name>Paulo Alcantara (SUSE)</name>
</author>
<published>2019-12-18T21:11:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=046aca3c25fd28da591f59a2dc1a01848e81e0b2'/>
<id>urn:sha1:046aca3c25fd28da591f59a2dc1a01848e81e0b2</id>
<content type='text'>
When listing a directory with thounsands of files and most of them are
reparse points, we simply marked all those dentries for revalidation
and then sending additional (compounded) create/getinfo/close requests
for each of them.

Instead, upon receiving a response from an SMB2_QUERY_DIRECTORY
(FileIdFullDirectoryInformation) command, the directory entries that
have a file attribute of FILE_ATTRIBUTE_REPARSE_POINT will contain an
EaSize field with a reparse tag in it, so we parse it and mark the
dentry for revalidation only if it is a DFS or a symlink.

Signed-off-by: Paulo Alcantara (SUSE) &lt;pc@cjr.nz&gt;
Reviewed-by: Pavel Shilovsky &lt;pshilov@microsoft.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: check ntwrk_buf_start for NULL before dereferencing it</title>
<updated>2018-12-24T04:41:31Z</updated>
<author>
<name>Ronnie Sahlberg</name>
</author>
<published>2018-12-12T22:06:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=59a63e479ce36a3f24444c3a36efe82b78e4a8e0'/>
<id>urn:sha1:59a63e479ce36a3f24444c3a36efe82b78e4a8e0</id>
<content type='text'>
RHBZ: 1021460

There is an issue where when multiple threads open/close the same directory
ntwrk_buf_start might end up being NULL, causing the call to smbCalcSize
later to oops with a NULL deref.

The real bug is why this happens and why this can become NULL for an
open cfile, which should not be allowed.
This patch tries to avoid a oops until the time when we fix the underlying
issue.

Signed-off-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: prevent integer overflow in nxt_dir_entry()</title>
<updated>2018-09-12T14:27:57Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2018-09-06T09:47:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8ad8aa353524d89fa2e09522f3078166ff78ec42'/>
<id>urn:sha1:8ad8aa353524d89fa2e09522f3078166ff78ec42</id>
<content type='text'>
The "old_entry + le32_to_cpu(pDirInfo-&gt;NextEntryOffset)" can wrap
around so I have added a check for integer overflow.

Reported-by: Dr Silvio Cesare of InfoSect &lt;silvio.cesare@gmail.com&gt;
Reviewed-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
Reviewed-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
CC: Stable &lt;stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>cifs: update calc_size to take a server argument</title>
<updated>2018-05-27T22:56:35Z</updated>
<author>
<name>Ronnie Sahlberg</name>
</author>
<published>2018-04-22T21:30:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9ec672bd17131fe26c966960a573a76fdb1da323'/>
<id>urn:sha1:9ec672bd17131fe26c966960a573a76fdb1da323</id>
<content type='text'>
and change the smb2 version to take heder_preamble_size into account
instead of hardcoding it as 4 bytes.

Signed-off-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: initialize file_info_lock</title>
<updated>2017-01-14T20:58:29Z</updated>
<author>
<name>Rabin Vincent</name>
</author>
<published>2017-01-13T14:00:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=81ddd8c0c5e1cb41184d66567140cb48c53eb3d1'/>
<id>urn:sha1:81ddd8c0c5e1cb41184d66567140cb48c53eb3d1</id>
<content type='text'>
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
CC: Stable &lt;stable@vger.kernel.org&gt;

file_info_lock is not initalized in initiate_cifs_search(), leading to the
following splat after a simple "mount.cifs ... dir &amp;&amp; ls dir/":

 BUG: spinlock bad magic on CPU#0, ls/486
  lock: 0xffff880009301110, .magic: 00000000, .owner: &lt;none&gt;/-1, .owner_cpu: 0
 CPU: 0 PID: 486 Comm: ls Not tainted 4.9.0 #27
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)
  ffffc900042f3db0 ffffffff81327533 0000000000000000 ffff880009301110
  ffffc900042f3dd0 ffffffff810baf75 ffff880009301110 ffffffff817ae077
  ffffc900042f3df0 ffffffff810baff6 ffff880009301110 ffff880008d69900
 Call Trace:
  [&lt;ffffffff81327533&gt;] dump_stack+0x65/0x92
  [&lt;ffffffff810baf75&gt;] spin_dump+0x85/0xe0
  [&lt;ffffffff810baff6&gt;] spin_bug+0x26/0x30
  [&lt;ffffffff810bb159&gt;] do_raw_spin_lock+0xe9/0x130
  [&lt;ffffffff8159ad2f&gt;] _raw_spin_lock+0x1f/0x30
  [&lt;ffffffff8127e50d&gt;] cifs_closedir+0x4d/0x100
  [&lt;ffffffff81181cfd&gt;] __fput+0x5d/0x160
  [&lt;ffffffff81181e3e&gt;] ____fput+0xe/0x10
  [&lt;ffffffff8109410e&gt;] task_work_run+0x7e/0xa0
  [&lt;ffffffff81002512&gt;] exit_to_usermode_loop+0x92/0xa0
  [&lt;ffffffff810026f9&gt;] syscall_return_slowpath+0x49/0x50
  [&lt;ffffffff8159b484&gt;] entry_SYSCALL_64_fastpath+0xa7/0xa9

Fixes: 3afca265b5f53a0 ("Clarify locking of cifs file and tcon structures and make more granular")
Signed-off-by: Rabin Vincent &lt;rabinv@axis.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
</feed>
