<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/cifs/readdir.c, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-02-20T09:09:02Z</updated>
<entry>
<title>cifs: check ntwrk_buf_start for NULL before dereferencing it</title>
<updated>2019-02-20T09:09:02Z</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=c20306485299080337731091c644da997278688c'/>
<id>urn:sha1:c20306485299080337731091c644da997278688c</id>
<content type='text'>
[ Upstream commit 59a63e479ce36a3f24444c3a36efe82b78e4a8e0 ]

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;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>cifs: prevent integer overflow in nxt_dir_entry()</title>
<updated>2018-09-26T06:33:58Z</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=cece1875d935c58d9dd6a2733be852948d5e1b6d'/>
<id>urn:sha1:cece1875d935c58d9dd6a2733be852948d5e1b6d</id>
<content type='text'>
commit 8ad8aa353524d89fa2e09522f3078166ff78ec42 upstream.

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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>cifs_dbg() outputs an uninitialized buffer in cifs_readdir()</title>
<updated>2016-02-10T03:57:06Z</updated>
<author>
<name>Vasily Averin</name>
</author>
<published>2016-01-14T10:41:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f04fed1a79dd7f195f735670153d3b0ec1f99eec'/>
<id>urn:sha1:f04fed1a79dd7f195f735670153d3b0ec1f99eec</id>
<content type='text'>
[ Upstream commit 01b9b0b28626db4a47d7f48744d70abca9914ef1 ]

In some cases tmp_bug can be not filled in cifs_filldir and stay uninitialized,
therefore its printk with "%s" modifier can leak content of kernelspace memory.
If old content of this buffer does not contain '\0' access bejond end of
allocated object can crash the host.

Signed-off-by: Vasily Averin &lt;vvs@virtuozzo.com&gt;
Signed-off-by: Steve French &lt;sfrench@localhost.localdomain&gt;
CC: Stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
</content>
</entry>
<entry>
<title>Remap reserved posix characters by default (part 3/3)</title>
<updated>2014-10-16T20:20:20Z</updated>
<author>
<name>Steve French</name>
</author>
<published>2014-09-27T07:19:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2baa2682531ff02928e2d3904800696d9e7193db'/>
<id>urn:sha1:2baa2682531ff02928e2d3904800696d9e7193db</id>
<content type='text'>
This is a bigger patch, but its size is mostly due to
a single change for how we check for remapping illegal characters
in file names - a lot of repeated, small changes to
the way callers request converting file names.

The final patch in the series does the following:

1) changes default behavior for cifs to be more intuitive.
Currently we do not map by default to seven reserved characters,
ie those valid in POSIX but not in NTFS/CIFS/SMB3/Windows,
unless a mount option (mapchars) is specified.  Change this
to by default always map and map using the SFM maping
(like the Mac uses) unless the server negotiates the CIFS Unix
Extensions (like Samba does when mounting with the cifs protocol)
when the remapping of the characters is unnecessary.  This should
help SMB3 mounts in particular since Samba will likely be
able to implement this mapping with its new "vfs_fruit" module
as it will be doing for the Mac.
2) if the user specifies the existing "mapchars" mount option then
use the "SFU" (Microsoft Services for Unix, SUA) style mapping of
the seven characters instead.
3) if the user specifies "nomapposix" then disable SFM/MAC style mapping
(so no character remapping would be used unless the user specifies
"mapchars" on mount as well, as above).
4) change all the places in the code that check for the superblock
flag on the mount which is set by mapchars and passed in on all
path based operation and change it to use a small function call
instead to set the mapping type properly (and check for the
mapping type in the cifs unicode functions)

Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>Allow conversion of characters in Mac remap range. Part 1</title>
<updated>2014-10-16T20:20:20Z</updated>
<author>
<name>Steve French</name>
</author>
<published>2014-09-25T18:20:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b693855fe67314d501aae74b9adff8788eb2fd82'/>
<id>urn:sha1:b693855fe67314d501aae74b9adff8788eb2fd82</id>
<content type='text'>
This allows directory listings to Mac to display filenames
correctly which have been created with illegal (to Windows)
characters in their filename. It does not allow
converting the other direction yet ie opening files with
these characters (followon patch).

There are seven reserved characters that need to be remapped when
mounting to Windows, Mac (or any server without Unix Extensions) which
are valid in POSIX but not in the other OS.

: \ &lt; &gt; ? * |

We used the normal UCS-2 remap range for this in order to convert this
to/from UTF8 as did Windows Services for Unix (basically add 0xF000 to
any of the 7 reserved characters), at least when the "mapchars" mount
option was specified.

Mac used a very slightly different "Services for Mac" remap range
0xF021 through 0xF027.  The attached patch allows cifs.ko (the kernel
client) to read directories on macs containing files with these
characters and display their names properly.  In theory this even
might be useful on mounts to Samba when the vfs_catia or new
"vfs_fruit" module is loaded.

Currently the 7 reserved characters look very strange in directory
listings from cifs.ko to Mac server.  This patch allows these file
name characters to be read (requires specifying mapchars on mount).

Two additional changes are needed:
1) Make it more automatic: a way of detecting enough info so that
we know to try to always remap these characters or not. Various
have suggested that the SFM approach be made the default when
the server does not support POSIX Unix extensions (cifs mounts
to Samba for example) so need to make SFM remapping the default
unless mapchars (SFU style mapping) specified on mount or no
mapping explicitly requested or no mapping needed (cifs mounts to Samba).

2) Adding a patch to map the characters the other direction
(ie UTF-8 to UCS-2 on open).  This patch does it for translating
readdir entries (ie UCS-2 to UTF-8)

Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Reviewed-by: Shirish Pargaonkar &lt;shirishpargaonkar@gmail.com&gt;
</content>
</entry>
<entry>
<title>vfs: Make d_invalidate return void</title>
<updated>2014-10-09T06:38:57Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2014-02-13T17:46:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5542aa2fa7f6cddb03c4ac3135e390adffda98ca'/>
<id>urn:sha1:5542aa2fa7f6cddb03c4ac3135e390adffda98ca</id>
<content type='text'>
Now that d_invalidate can no longer fail, stop returning a useless
return code.  For the few callers that checked the return code update
remove the handling of d_invalidate failure.

Reviewed-by: Miklos Szeredi &lt;miklos@szeredi.hu&gt;
Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>CIFS: Fix wrong restart readdir for SMB1</title>
<updated>2014-08-25T21:44:28Z</updated>
<author>
<name>Pavel Shilovsky</name>
</author>
<published>2014-08-26T15:04:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f736906a7669a77cf8cabdcbcf1dc8cb694e12ef'/>
<id>urn:sha1:f736906a7669a77cf8cabdcbcf1dc8cb694e12ef</id>
<content type='text'>
The existing code calls server-&gt;ops-&gt;close() that is not
right. This causes XFS test generic/310 to fail. Fix this
by using server-&gt;ops-&gt;closedir() function.

Cc: &lt;stable@vger.kernel.org&gt; # v3.7+
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Pavel Shilovsky &lt;pshilovsky@samba.org&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>CIFS: Fix SMB2 readdir error handling</title>
<updated>2014-08-17T10:08:39Z</updated>
<author>
<name>Pavel Shilovsky</name>
</author>
<published>2014-08-18T16:49:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=52755808d4525f4d5b86d112d36ffc7a46f3fb48'/>
<id>urn:sha1:52755808d4525f4d5b86d112d36ffc7a46f3fb48</id>
<content type='text'>
SMB2 servers indicates the end of a directory search with
STATUS_NO_MORE_FILE error code that is not processed now.
This causes generic/257 xfstest to fail. Fix this by triggering
the end of search by this error code in SMB2_query_directory.

Also when negotiating CIFS protocol we tell the server to close
the search automatically at the end and there is no need to do
it itself. In the case of SMB2 protocol, we need to close it
explicitly - separate close directory checks for different
protocols.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Pavel Shilovsky &lt;pshilovsky@samba.org&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: Rename MF symlink function names</title>
<updated>2014-01-20T06:13:54Z</updated>
<author>
<name>Sachin Prabhu</name>
</author>
<published>2013-11-25T17:09:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb084b1a9be34729bea23428c1a42f7d2f5defbc'/>
<id>urn:sha1:cb084b1a9be34729bea23428c1a42f7d2f5defbc</id>
<content type='text'>
Clean up camel case in functionnames.

Signed-off-by: Sachin Prabhu &lt;sprabhu@redhat.com&gt;
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>CIFS: Fix symbolic links usage</title>
<updated>2013-11-11T22:31:03Z</updated>
<author>
<name>Pavel Shilovsky</name>
</author>
<published>2013-10-23T13:49:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eb85d94bdd91fb4dbea4ee465d4349cbea4eaaca'/>
<id>urn:sha1:eb85d94bdd91fb4dbea4ee465d4349cbea4eaaca</id>
<content type='text'>
Now we treat any reparse point as a symbolic link and map it to a Unix
one that is not true in a common case due to many reparse point types
supported by SMB servers.

Distinguish reparse point types into two groups:
1) that can be accessed directly through a reparse point
(junctions, deduplicated files, NFS symlinks);
2) that need to be processed manually (Windows symbolic links, DFS);

and map only Windows symbolic links to Unix ones.

Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Reported-and-tested-by: Joao Correia &lt;joaomiguelcorreia@gmail.com&gt;
Signed-off-by: Pavel Shilovsky &lt;piastry@etersoft.ru&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
</feed>
