<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/cifs/dir.c, branch linux-4.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-02-10T08:09:26Z</updated>
<entry>
<title>cifs: report error instead of invalid when revalidating a dentry fails</title>
<updated>2021-02-10T08:09:26Z</updated>
<author>
<name>Aurelien Aptel</name>
</author>
<published>2021-02-05T14:42:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=57659a80d5278d12bf7fd4f1d0b78e44a36f0d34'/>
<id>urn:sha1:57659a80d5278d12bf7fd4f1d0b78e44a36f0d34</id>
<content type='text'>
commit 21b200d091826a83aafc95d847139b2b0582f6d1 upstream.

Assuming
- //HOST/a is mounted on /mnt
- //HOST/b is mounted on /mnt/b

On a slow connection, running 'df' and killing it while it's
processing /mnt/b can make cifs_get_inode_info() returns -ERESTARTSYS.

This triggers the following chain of events:
=&gt; the dentry revalidation fail
=&gt; dentry is put and released
=&gt; superblock associated with the dentry is put
=&gt; /mnt/b is unmounted

This patch makes cifs_d_revalidate() return the error instead of 0
(invalid) when cifs_revalidate_dentry() fails, except for ENOENT (file
deleted) and ESTALE (file recreated).

Signed-off-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
Suggested-by: Shyam Prasad N &lt;nspmangalore@gmail.com&gt;
Reviewed-by: Shyam Prasad N &lt;nspmangalore@gmail.com&gt;
CC: stable@vger.kernel.org
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_atomic_open(): fix double-put on late allocation failure</title>
<updated>2020-03-20T08:07:44Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2020-03-12T22:25:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca9a513b01100a557f99fe69abcd3d664ff88b40'/>
<id>urn:sha1:ca9a513b01100a557f99fe69abcd3d664ff88b40</id>
<content type='text'>
commit d9a9f4849fe0c9d560851ab22a85a666cddfdd24 upstream.

several iterations of -&gt;atomic_open() calling conventions ago, we
used to need fput() if -&gt;atomic_open() failed at some point after
successful finish_open().  Now (since 2016) it's not needed -
struct file carries enough state to make fput() work regardless
of the point in struct file lifecycle and discarding it on
failure exits in open() got unified.  Unfortunately, I'd missed
the fact that we had an instance of -&gt;atomic_open() (cifs one)
that used to need that fput(), as well as the stale comment in
finish_open() demanding such late failure handling.  Trivially
fixed...

Fixes: fe9ec8291fca "do_last(): take fput() on error after opening to out:"
Cc: stable@kernel.org # v4.7+
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>CIFS: Force reval dentry if LOOKUP_REVAL flag is set</title>
<updated>2019-10-17T20:42:44Z</updated>
<author>
<name>Pavel Shilovsky</name>
</author>
<published>2019-09-30T17:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5736d6e32736065a3a3a58578d6d33e061c69777'/>
<id>urn:sha1:5736d6e32736065a3a3a58578d6d33e061c69777</id>
<content type='text'>
commit 0b3d0ef9840f7be202393ca9116b857f6f793715 upstream.

Mark inode for force revalidation if LOOKUP_REVAL flag is set.
This tells the client to actually send a QueryInfo request to
the server to obtain the latest metadata in case a directory
or a file were changed remotely. Only do that if the client
doesn't have a lease for the file to avoid unneeded round
trips to the server.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Pavel Shilovsky &lt;pshilov@microsoft.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: Fix separator when building path from dentry</title>
<updated>2018-12-13T08:20:29Z</updated>
<author>
<name>Paulo Alcantara</name>
</author>
<published>2018-11-15T14:20:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fcfc76397dbd253cee51eb3fc84c9f03602ece9b'/>
<id>urn:sha1:fcfc76397dbd253cee51eb3fc84c9f03602ece9b</id>
<content type='text'>
commit c988de29ca161823db6a7125e803d597ef75b49c upstream.

Make sure to use the CIFS_DIR_SEP(cifs_sb) as path separator for
prefixpath too. Fixes a bug with smb1 UNIX extensions.

Fixes: a6b5058fafdf ("fs/cifs: make share unaccessible at root level mountable")
Signed-off-by: Paulo Alcantara &lt;palcantara@suse.com&gt;
Reviewed-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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>cifs: do not allow creating sockets except with SMB1 posix exensions</title>
<updated>2018-04-29T09:31:55Z</updated>
<author>
<name>Steve French</name>
</author>
<published>2018-04-20T17:19:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=193038d913f47563594814c1011a3c40e15b86ac'/>
<id>urn:sha1:193038d913f47563594814c1011a3c40e15b86ac</id>
<content type='text'>
commit 1d0cffa674cfa7d185a302c8c6850fc50b893bed upstream.

RHBZ: 1453123

Since at least the 3.10 kernel and likely a lot earlier we have
not been able to create unix domain sockets in a cifs share
when mounted using the SFU mount option (except when mounted
with the cifs unix extensions to Samba e.g.)
Trying to create a socket, for example using the af_unix command from
xfstests will cause :
BUG: unable to handle kernel NULL pointer dereference at 00000000
00000040

Since no one uses or depends on being able to create unix domains sockets
on a cifs share the easiest fix to stop this vulnerability is to simply
not allow creation of any other special files than char or block devices
when sfu is used.

Added update to Ronnie's patch to handle a tcon link leak, and
to address a buf leak noticed by Gustavo and Colin.

Acked-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
CC:  Colin Ian King &lt;colin.king@canonical.com&gt;
Reviewed-by: Pavel Shilovsky &lt;pshilov@microsoft.com&gt;
Reported-by: Eryu Guan &lt;eguan@redhat.com&gt;
Signed-off-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>cifs: check MaxPathNameComponentLength != 0 before using it</title>
<updated>2017-11-08T09:08:31Z</updated>
<author>
<name>Ronnie Sahlberg</name>
</author>
<published>2017-10-30T02:28:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e8b028abaf85502c53fb3af795f3c61d7cbcdc8'/>
<id>urn:sha1:5e8b028abaf85502c53fb3af795f3c61d7cbcdc8</id>
<content type='text'>
commit f74bc7c6679200a4a83156bb89cbf6c229fe8ec0 upstream.

And fix tcon leak in error path.

Signed-off-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Reviewed-by: David Disseldorp &lt;ddiss@samba.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>CIFS: remove endian related sparse warning</title>
<updated>2017-09-07T06:35:40Z</updated>
<author>
<name>Steve French</name>
</author>
<published>2017-08-27T21:56:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e2ae90bb85f83918c667942d9fff587c73cc1a8c'/>
<id>urn:sha1:e2ae90bb85f83918c667942d9fff587c73cc1a8c</id>
<content type='text'>
commit 6e3c1529c39e92ed64ca41d53abadabbaa1d5393 upstream.

Recent patch had an endian warning ie
cifs: return ENAMETOOLONG for overlong names in cifs_open()/cifs_lookup()

Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
CC: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
Acked-by: Pavel Shilovsky &lt;pshilov@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>cifs: return ENAMETOOLONG for overlong names in cifs_open()/cifs_lookup()</title>
<updated>2017-08-30T08:21:49Z</updated>
<author>
<name>Ronnie Sahlberg</name>
</author>
<published>2017-08-23T04:48:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5ed70f7db9afe5e4e5cc1fa2239676e3b2d2c5b2'/>
<id>urn:sha1:5ed70f7db9afe5e4e5cc1fa2239676e3b2d2c5b2</id>
<content type='text'>
commit d3edede29f74d335f81d95a4588f5f136a9f7dcf upstream.

Add checking for the path component length and verify it is &lt;= the maximum
that the server advertizes via FileFsAttributeInformation.

With this patch cifs.ko will now return ENAMETOOLONG instead of ENOENT
when users to access an overlong path.

To test this, try to cd into a (non-existing) directory on a CIFS share
that has a too long name:
cd /mnt/aaaaaaaaaaaaaaa...

and it now should show a good error message from the shell:
bash: cd: /mnt/aaaaaaaaaaaaaaaa...aaaaaa: File name too long

rh bz 1153996

Signed-off-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>cifs: don't use -&gt;d_time</title>
<updated>2016-09-16T10:44:21Z</updated>
<author>
<name>Miklos Szeredi</name>
</author>
<published>2016-09-16T10:44:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a00be0e31f8df453ecbaaa4ba78d2ef935ab252e'/>
<id>urn:sha1:a00be0e31f8df453ecbaaa4ba78d2ef935ab252e</id>
<content type='text'>
Use d_fsdata instead, which is the same size.  Introduce helpers to hide
the typecasts.

Signed-off-by: Miklos Szeredi &lt;mszeredi@redhat.com&gt;
Cc: Steve French &lt;sfrench@samba.org&gt;
</content>
</entry>
<entry>
<title>get rid of 'parent' argument of -&gt;d_compare()</title>
<updated>2016-07-31T20:37:25Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2016-07-31T20:37:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6fa67e707559303e086303aeecc9e8b91ef497d5'/>
<id>urn:sha1:6fa67e707559303e086303aeecc9e8b91ef497d5</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
