<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/cifs, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-10-06T08:22:23Z</updated>
<entry>
<title>cifs: fix incorrect check for null pointer in header_assemble</title>
<updated>2021-10-06T08:22:23Z</updated>
<author>
<name>Steve French</name>
</author>
<published>2021-09-24T00:18:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e73e069615cdbf692b47ff52122e00cdc2076a1'/>
<id>urn:sha1:6e73e069615cdbf692b47ff52122e00cdc2076a1</id>
<content type='text'>
commit 9ed38fd4a15417cac83967360cf20b853bfab9b6 upstream.

Although very unlikely that the tlink pointer would be null in this case,
get_next_mid function can in theory return null (but not an error)
so need to check for null (not for IS_ERR, which can not be returned
here).

Address warning:

        fs/smbfs_client/connect.c:2392 cifs_match_super()
        warn: 'tlink' isn't an ERR_PTR

Pointed out by Dan Carpenter via smatch code analysis tool

CC: stable@vger.kernel.org
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Ronnie Sahlberg &lt;lsahlber@redhat.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 wrong release in sess_alloc_buffer() failed path</title>
<updated>2021-09-22T09:41:26Z</updated>
<author>
<name>Ding Hui</name>
</author>
<published>2021-08-17T14:55:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d4a127e2a11650ead18d0307268dbe3c9a687468'/>
<id>urn:sha1:d4a127e2a11650ead18d0307268dbe3c9a687468</id>
<content type='text'>
[ Upstream commit d72c74197b70bc3c95152f351a568007bffa3e11 ]

smb_buf is allocated by small_smb_init_no_tc(), and buf type is
CIFS_SMALL_BUFFER, so we should use cifs_small_buf_release() to
release it in failed path.

Signed-off-by: Ding Hui &lt;dinghui@sangfor.com.cn&gt;
Reviewed-by: Paulo Alcantara (SUSE) &lt;pc@cjr.nz&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: Fix a potencially linear read overflow</title>
<updated>2021-09-22T09:41:21Z</updated>
<author>
<name>Len Baker</name>
</author>
<published>2021-08-17T10:27:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0955df2d9bf4857e3e2287e3028903e6cec06c30'/>
<id>urn:sha1:0955df2d9bf4857e3e2287e3028903e6cec06c30</id>
<content type='text'>
[ Upstream commit f980d055a0f858d73d9467bb0b570721bbfcdfb8 ]

strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated.

Also, the strnlen() call does not avoid the read overflow in the strlcpy
function when a not NUL-terminated string is passed.

So, replace this block by a call to kstrndup() that avoids this type of
overflow and does the same.

Fixes: 066ce6899484d ("cifs: rename cifs_strlcpy_to_host and make it use new functions")
Signed-off-by: Len Baker &lt;len.baker@gmx.com&gt;
Reviewed-by: Paulo Alcantara (SUSE) &lt;pc@cjr.nz&gt;
Reviewed-by: Jeff Layton &lt;jlayton@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>cifs: fix memory leak in smb2_copychunk_range</title>
<updated>2021-05-26T09:27:32Z</updated>
<author>
<name>Ronnie Sahlberg</name>
</author>
<published>2021-05-18T22:40:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ae3b61a3dc2321f5dc5b3b07dca1d967d7bdc298'/>
<id>urn:sha1:ae3b61a3dc2321f5dc5b3b07dca1d967d7bdc298</id>
<content type='text'>
commit d201d7631ca170b038e7f8921120d05eec70d7c5 upstream.

When using smb2_copychunk_range() for large ranges we will
run through several iterations of a loop calling SMB2_ioctl()
but never actually free the returned buffer except for the final
iteration.
This leads to memory leaks everytime a large copychunk is requested.

Fixes: 9bf0c9cd4314 ("CIFS: Fix SMB2/SMB3 Copy offload support (refcopy) for large files")
Cc: &lt;stable@vger.kernel.org&gt;
Reviewed-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
Signed-off-by: Ronnie Sahlberg &lt;lsahlber@redhat.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: Silently ignore unknown oplock break handle</title>
<updated>2021-04-10T11:01:57Z</updated>
<author>
<name>Vincent Whitchurch</name>
</author>
<published>2021-03-19T13:57:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d2eb295256e7f24e20b35d738300a9b4cbef9548'/>
<id>urn:sha1:d2eb295256e7f24e20b35d738300a9b4cbef9548</id>
<content type='text'>
[ Upstream commit 219481a8f90ec3a5eed9638fb35609e4b1aeece7 ]

Make SMB2 not print out an error when an oplock break is received for an
unknown handle, similar to SMB1.  The debug message which is printed for
these unknown handles may also be misleading, so fix that too.

The SMB2 lease break path is not affected by this patch.

Without this, a program which writes to a file from one thread, and
opens, reads, and writes the same file from another thread triggers the
below errors several times a minute when run against a Samba server
configured with "smb2 leases = no".

 CIFS: VFS: \\192.168.0.1 No task to wake, unknown frame received! NumMids 2
 00000000: 424d53fe 00000040 00000000 00000012  .SMB@...........
 00000010: 00000001 00000000 ffffffff ffffffff  ................
 00000020: 00000000 00000000 00000000 00000000  ................
 00000030: 00000000 00000000 00000000 00000000  ................

Signed-off-by: Vincent Whitchurch &lt;vincent.whitchurch@axis.com&gt;
Reviewed-by: Tom Talpey &lt;tom@talpey.com&gt;
Reviewed-by: Paulo Alcantara (SUSE) &lt;pc@cjr.nz&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: revalidate mapping when we open files for SMB1 POSIX</title>
<updated>2021-04-10T11:01:57Z</updated>
<author>
<name>Ronnie Sahlberg</name>
</author>
<published>2021-03-25T06:26:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=41466e53121e61e4982afdcd41f4ad3e683cae4a'/>
<id>urn:sha1:41466e53121e61e4982afdcd41f4ad3e683cae4a</id>
<content type='text'>
[ Upstream commit cee8f4f6fcabfdf229542926128e9874d19016d5 ]

RHBZ: 1933527

Under SMB1 + POSIX, if an inode is reused on a server after we have read and
cached a part of a file, when we then open the new file with the
re-cycled inode there is a chance that we may serve the old data out of cache
to the application.
This only happens for SMB1 (deprecated) and when posix are used.
The simplest solution to avoid this race is to force a revalidate
on smb1-posix open.

Signed-off-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
Reviewed-by: Paulo Alcantara (SUSE) &lt;pc@cjr.nz&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: return proper error code in statfs(2)</title>
<updated>2021-03-17T15:07:19Z</updated>
<author>
<name>Paulo Alcantara</name>
</author>
<published>2021-03-08T15:00:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a1947c54c6d98bdacd115af05aa0f36758ceed7d'/>
<id>urn:sha1:a1947c54c6d98bdacd115af05aa0f36758ceed7d</id>
<content type='text'>
commit 14302ee3301b3a77b331cc14efb95bf7184c73cc upstream.

In cifs_statfs(), if server-&gt;ops-&gt;queryfs is not NULL, then we should
use its return value rather than always returning 0.  Instead, use rc
variable as it is properly set to 0 in case there is no
server-&gt;ops-&gt;queryfs.

Signed-off-by: Paulo Alcantara (SUSE) &lt;pc@cjr.nz&gt;
Reviewed-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
Reviewed-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
CC: &lt;stable@vger.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>cifs: report error instead of invalid when revalidating a dentry fails</title>
<updated>2021-02-10T08:07:27Z</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=7a3d11f90d32f84767d35e9adcd53e401f526615'/>
<id>urn:sha1:7a3d11f90d32f84767d35e9adcd53e401f526615</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: fix potential use-after-free in cifs_echo_request()</title>
<updated>2020-12-11T12:36:45Z</updated>
<author>
<name>Paulo Alcantara</name>
</author>
<published>2020-11-28T19:54:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=87a3af64297a144ee9ab160cd55cfb90ef56305a'/>
<id>urn:sha1:87a3af64297a144ee9ab160cd55cfb90ef56305a</id>
<content type='text'>
commit 212253367dc7b49ed3fc194ce71b0992eacaecf2 upstream.

This patch fixes a potential use-after-free bug in
cifs_echo_request().

For instance,

  thread 1
  --------
  cifs_demultiplex_thread()
    clean_demultiplex_info()
      kfree(server)

  thread 2 (workqueue)
  --------
  apic_timer_interrupt()
    smp_apic_timer_interrupt()
      irq_exit()
        __do_softirq()
          run_timer_softirq()
            call_timer_fn()
	      cifs_echo_request() &lt;- use-after-free in server ptr

Signed-off-by: Paulo Alcantara (SUSE) &lt;pc@cjr.nz&gt;
CC: Stable &lt;stable@vger.kernel.org&gt;
Reviewed-by: Ronnie Sahlberg &lt;lsahlber@redhat.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>Convert trailing spaces and periods in path components</title>
<updated>2020-11-18T17:25:04Z</updated>
<author>
<name>Boris Protopopov</name>
</author>
<published>2020-09-24T00:36:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4000c1b820087964a8c68cf7d5de71036f962107'/>
<id>urn:sha1:4000c1b820087964a8c68cf7d5de71036f962107</id>
<content type='text'>
commit 57c176074057531b249cf522d90c22313fa74b0b upstream.

When converting trailing spaces and periods in paths, do so
for every component of the path, not just the last component.
If the conversion is not done for every path component, then
subsequent operations in directories with trailing spaces or
periods (e.g. create(), mkdir()) will fail with ENOENT. This
is because on the server, the directory will have a special
symbol in its name, and the client needs to provide the same.

Signed-off-by: Boris Protopopov &lt;pboris@amazon.com&gt;
Acked-by: Ronnie Sahlberg &lt;lsahlber@redhat.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>
</feed>
