<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/cifs/link.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-06-12T13:54:12Z</updated>
<entry>
<title>smb311: add support for using info level for posix extensions query</title>
<updated>2020-06-12T13:54:12Z</updated>
<author>
<name>Steve French</name>
</author>
<published>2020-06-12T03:43:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d313852d7ad044476df7f640801aac17080e0521'/>
<id>urn:sha1:d313852d7ad044476df7f640801aac17080e0521</id>
<content type='text'>
Adds calls to the newer info level for query info using SMB3.1.1 posix extensions.
The remaining two places that call the older query info (non-SMB3.1.1 POSIX)
require passing in the fid and can be updated in a later patch.

Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Reviewed-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
</content>
</entry>
<entry>
<title>cifs: multichannel: move channel selection above transport layer</title>
<updated>2020-06-04T18:50:55Z</updated>
<author>
<name>Aurelien Aptel</name>
</author>
<published>2020-05-31T17:38:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=352d96f3acc6e02099f58a24d5cabce7f8ee061f'/>
<id>urn:sha1:352d96f3acc6e02099f58a24d5cabce7f8ee061f</id>
<content type='text'>
Move the channel (TCP_Server_Info*) selection from the tranport
layer to higher in the call stack so that:

- credit handling is done with the server that will actually be used
  to send.
  * -&gt;wait_mtu_credit
  * -&gt;set_credits / set_credits
  * -&gt;add_credits / add_credits
  * add_credits_and_wake_if

- potential reconnection (smb2_reconnect) done when initializing a
  request is checked and done with the server that will actually be
  used to send.

To do this:

- remove the cifs_pick_channel() call out of compound_send_recv()

- select channel and pass it down by adding a cifs_pick_channel(ses)
  call in:
  - smb311_posix_mkdir
  - SMB2_open
  - SMB2_ioctl
  - __SMB2_close
  - query_info
  - SMB2_change_notify
  - SMB2_flush
  - smb2_async_readv  (if none provided in context param)
  - SMB2_read         (if none provided in context param)
  - smb2_async_writev (if none provided in context param)
  - SMB2_write        (if none provided in context param)
  - SMB2_query_directory
  - send_set_info
  - SMB2_oplock_break
  - SMB311_posix_qfs_info
  - SMB2_QFS_info
  - SMB2_QFS_attr
  - smb2_lockv
  - SMB2_lease_break
    - smb2_compound_op
  - smb2_set_ea
  - smb2_ioctl_query_info
  - smb2_query_dir_first
  - smb2_query_info_comound
  - smb2_query_symlink
  - cifs_writepages
  - cifs_write_from_iter
  - cifs_send_async_read
  - cifs_read
  - cifs_readpages

- add TCP_Server_Info *server param argument to:
  - cifs_send_recv
  - compound_send_recv
  - SMB2_open_init
  - SMB2_query_info_init
  - SMB2_set_info_init
  - SMB2_close_init
  - SMB2_ioctl_init
  - smb2_iotcl_req_init
  - SMB2_query_directory_init
  - SMB2_notify_init
  - SMB2_flush_init
  - build_qfs_info_req
  - smb2_hdr_assemble
  - smb2_reconnect
  - fill_small_buf
  - smb2_plain_req_init
  - __smb2_plain_req_init

The read/write codepath is different than the rest as it is using
pages, io iterators and async calls. To deal with those we add a
server pointer in the cifs_writedata/cifs_readdata/cifs_io_parms
context struct and set it in:

- cifs_writepages      (wdata)
- cifs_write_from_iter (wdata)
- cifs_readpages       (rdata)
- cifs_send_async_read (rdata)

The [rw]data-&gt;server pointer is eventually copied to
cifs_io_parms-&gt;server to pass it down to SMB2_read/SMB2_write.
If SMB2_read/SMB2_write is called from a different place that doesn't
set the server field it will pick a channel.

Some places do not pick a channel and just use ses-&gt;server or
cifs_ses_server(ses). All cifs_ses_server(ses) calls are in codepaths
involving negprot/sess.setup.

- SMB2_negotiate         (binding channel)
- SMB2_sess_alloc_buffer (binding channel)
- SMB2_echo              (uses provided one)
- SMB2_logoff            (uses master)
- SMB2_tdis              (uses master)

(list not exhaustive)

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: multichannel: always zero struct cifs_io_parms</title>
<updated>2020-06-04T18:50:55Z</updated>
<author>
<name>Aurelien Aptel</name>
</author>
<published>2020-06-04T15:23:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7c06514afd38ed7a4b83edfd39ab033c804b4cf3'/>
<id>urn:sha1:7c06514afd38ed7a4b83edfd39ab033c804b4cf3</id>
<content type='text'>
SMB2_read/SMB2_write check and use cifs_io_parms-&gt;server, which might
be uninitialized memory.

This change makes all callers zero-initialize the struct.

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: add SMB2_open() arg to return POSIX data</title>
<updated>2020-03-23T03:49:09Z</updated>
<author>
<name>Aurelien Aptel</name>
</author>
<published>2020-03-02T16:53:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=69dda3059e7a4dbe02b05a38b4a066919da38a45'/>
<id>urn:sha1:69dda3059e7a4dbe02b05a38b4a066919da38a45</id>
<content type='text'>
allows SMB2_open() callers to pass down a POSIX data buffer that will
trigger requesting POSIX create context and parsing the response into
the provided buffer.

Signed-off-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Reviewed-by: Paulo Alcantara (SUSE) &lt;pc@cjr.nz&gt;
</content>
</entry>
<entry>
<title>SMB3: Backup intent flag missing from some more ops</title>
<updated>2020-02-03T22:12:47Z</updated>
<author>
<name>Amir Goldstein</name>
</author>
<published>2020-02-03T19:46:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0f060936e490c6279dfe773d75d526d3d3d77111'/>
<id>urn:sha1:0f060936e490c6279dfe773d75d526d3d3d77111</id>
<content type='text'>
When "backup intent" is requested on the mount (e.g. backupuid or
backupgid mount options), the corresponding flag was missing from
some of the operations.

Change all operations to use the macro cifs_create_options() to
set the backup intent flag if needed.

Signed-off-by: Amir Goldstein &lt;amir73il@gmail.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>SMB3: Clean up query symlink when reparse point</title>
<updated>2019-05-08T04:24:55Z</updated>
<author>
<name>Ronnie Sahlberg</name>
</author>
<published>2019-04-09T22:44:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ebaf546a5584d0a75aa61e4872771008715b8639'/>
<id>urn:sha1:ebaf546a5584d0a75aa61e4872771008715b8639</id>
<content type='text'>
Two of the common symlink formats use reparse points
(unlike mfsymlinks and also unlike the SMB1 posix
extensions).  This is the first part of the fixes
to allow these reparse points (NFS style and Windows
symlinks) to be resolved properly as symlinks by the
client.

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: replace snprintf with scnprintf</title>
<updated>2019-03-05T02:05:34Z</updated>
<author>
<name>Ronnie Sahlberg</name>
</author>
<published>2019-02-08T23:51:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74ea5f983f9e86ebb4b7ed611937776dab18c67e'/>
<id>urn:sha1:74ea5f983f9e86ebb4b7ed611937776dab18c67e</id>
<content type='text'>
a trivial patch that replaces all use of snprintf with scnprintf.
scnprintf() is generally seen as a safer function to use than
snprintf for many use cases.

In our case, there is no actual difference between the two since we never
look at the return value. Thus we did not have any of the bugs that
scnprintf protects against and the patch does nothing.

However, for people reading our code it will be a receipt that we
have done our due dilligence and checked our code for this type of bugs.

See the presentation "Making C Less Dangerous In The Linux Kernel"
at this years LCA

Signed-off-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>smb3: don't request leases in symlink creation and query</title>
<updated>2018-08-07T19:15:57Z</updated>
<author>
<name>Steve French</name>
</author>
<published>2018-07-28T03:01:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22783155f4bf956c346a81624ec9258930a6fe06'/>
<id>urn:sha1:22783155f4bf956c346a81624ec9258930a6fe06</id>
<content type='text'>
Fixes problem pointed out by Pavel in discussions about commit
729c0c9dd55204f0c9a823ac8a7bfa83d36c7e78

Signed-off-by: Pavel Shilovsky &lt;pshilov@microsoft.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Reviewed-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
CC: Stable &lt;stable@vger.kernel.org&gt; # 3.18.x+
</content>
</entry>
<entry>
<title>cifs: fix a buffer leak in smb2_query_symlink</title>
<updated>2018-06-08T04:39:41Z</updated>
<author>
<name>Ronnie Sahlberg</name>
</author>
<published>2018-06-08T03:21:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9d874c36552afbd08778687aeaff24a8a7260f20'/>
<id>urn:sha1:9d874c36552afbd08778687aeaff24a8a7260f20</id>
<content type='text'>
This leak was introduced in 91cb74f5142c14dd921ab2d064b7b128054f9fae and caused us
to leak one small buffer for every symlink query.

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: refactor crypto shash/sdesc allocation&amp;free</title>
<updated>2018-04-02T01:24:39Z</updated>
<author>
<name>Aurelien Aptel</name>
</author>
<published>2018-02-16T18:19:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=82fb82be05585426405667dd5f0510aa953ba439'/>
<id>urn:sha1:82fb82be05585426405667dd5f0510aa953ba439</id>
<content type='text'>
shash and sdesc and always allocated and freed together.
* abstract this in new functions cifs_alloc_hash() and cifs_free_hash().
* make smb2/3 crypto allocation independent from each other.

Signed-off-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
Reviewed-by: Ronnie Sahlberg &lt;lsahlber@redhat.com&gt;
CC: Stable &lt;stable@vger.kernel.org&gt;
</content>
</entry>
</feed>
