<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/fs/cifs/ioctl.c, branch jd/unified-crypt-queue</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/fs/cifs/ioctl.c?h=jd%2Funified-crypt-queue</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/fs/cifs/ioctl.c?h=jd%2Funified-crypt-queue'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-02-06T15:14:28Z</updated>
<entry>
<title>cifs: add SMB3 change notification support</title>
<updated>2020-02-06T15:14:28Z</updated>
<author>
<name>Steve French</name>
<email>stfrench@microsoft.com</email>
</author>
<published>2020-02-06T12:00:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=d26c2ddd33569667e3eeb577c4c1d966ca9192e2'/>
<id>urn:sha1:d26c2ddd33569667e3eeb577c4c1d966ca9192e2</id>
<content type='text'>
A commonly used SMB3 feature is change notification, allowing an
app to be notified about changes to a directory. The SMB3
Notify request blocks until the server detects a change to that
directory or its contents that matches the completion flags
that were passed in and the "watch_tree" flag (which indicates
whether subdirectories under this directory should be also
included).  See MS-SMB2 2.2.35 for additional detail.

To use this simply pass in the following structure to ioctl:

 struct __attribute__((__packed__)) smb3_notify {
        uint32_t completion_filter;
        bool    watch_tree;
 } __packed;

 using CIFS_IOC_NOTIFY  0x4005cf09
 or equivalently _IOW(CIFS_IOCTL_MAGIC, 9, struct smb3_notify)

SMB3 change notification is supported by all major servers.
The ioctl will block until the server detects a change to that
directory or its subdirectories (if watch_tree is set).

Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
Reviewed-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
Acked-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>
<email>amir73il@gmail.com</email>
</author>
<published>2020-02-03T19:46:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/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: allow decryption keys to be dumped by admin for debugging</title>
<updated>2019-09-21T11:02:26Z</updated>
<author>
<name>Steve French</name>
<email>stfrench@microsoft.com</email>
</author>
<published>2019-09-19T09:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=7e7db86c7e1088e768438fe6c894d748b0c32abe'/>
<id>urn:sha1:7e7db86c7e1088e768438fe6c894d748b0c32abe</id>
<content type='text'>
In order to debug certain problems it is important to be able
to decrypt network traces (e.g. wireshark) but to do this we
need to be able to dump out the encryption/decryption keys.
Dumping them to an ioctl is safer than dumping then to dmesg,
(and better than showing all keys in a pseudofile).

Restrict this to root (CAP_SYS_ADMIN), and only for a mount
that this admin has access to.

Sample smbinfo output:
SMB3.0 encryption
Session Id:   0x82d2ec52
Session Key:  a5 6d 81 d0 e c1 ca e1 d8 13 aa 20 e8 f2 cc 71
Server Encryption Key:  1a c3 be ba 3d fc dc 3c e bc 93 9e 50 9e 19 c1
Server Decryption Key:  e0 d4 d9 43 1b a2 1b e3 d8 76 77 49 56 f7 20 88

Reviewed-by: Aurelien Aptel &lt;aaptel@suse.com&gt;
Pavel Shilovsky &lt;pshilov@microsoft.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: add support for ioctl on directories</title>
<updated>2018-10-24T02:16:05Z</updated>
<author>
<name>Ronnie Sahlberg</name>
<email>lsahlber@redhat.com</email>
</author>
<published>2018-10-16T19:47:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=8d8b26e58432cb2840048b9f8aea286be6f75de5'/>
<id>urn:sha1:8d8b26e58432cb2840048b9f8aea286be6f75de5</id>
<content type='text'>
We do not call cifs_open_file() for directories and thus we do not have a
pSMBFile we can extract the FIDs from.

Solve this by instead always using a compounded open/query/close for
the passthrough ioctl.

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: add IOCTL for QUERY_INFO passthrough to userspace</title>
<updated>2018-10-24T02:16:05Z</updated>
<author>
<name>Ronnie Sahlberg</name>
<email>lsahlber@redhat.com</email>
</author>
<published>2018-10-08T00:19:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=f5b05d622a3e99e6a97a189fe500414be802a05c'/>
<id>urn:sha1:f5b05d622a3e99e6a97a189fe500414be802a05c</id>
<content type='text'>
This allows userspace tools to query the raw info levels for cifs files
and process the response in userspace.
In particular this is useful for many of those data where there is no
corresponding native data structure in linux.
For example querying the security descriptor for a file and extract the
SIDs.

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: remove set but not used variable 'cifs_sb'</title>
<updated>2018-10-24T02:16:03Z</updated>
<author>
<name>YueHaibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2018-09-06T01:50:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=ce7fb50f92d78cf9cd35a520d293a4b791c8d7a1'/>
<id>urn:sha1:ce7fb50f92d78cf9cd35a520d293a4b791c8d7a1</id>
<content type='text'>
Fixes gcc '-Wunused-but-set-variable' warning:

fs/cifs/ioctl.c: In function 'cifs_ioctl':
fs/cifs/ioctl.c:164:23: warning:
 variable 'cifs_sb' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Signed-off-by: Steve French &lt;stfrench@microsoft.com&gt;
</content>
</entry>
<entry>
<title>[SMB3] Remove ifdef since SMB3 (and later) now STRONGLY preferred</title>
<updated>2017-07-08T23:57:07Z</updated>
<author>
<name>Steve French</name>
<email>smfrench@gmail.com</email>
</author>
<published>2017-07-08T23:48:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=2a38e12053b760a8f5e85030eb89512660077c15'/>
<id>urn:sha1:2a38e12053b760a8f5e85030eb89512660077c15</id>
<content type='text'>
Remove the CONFIG_CIFS_SMB2 ifdef and Kconfig option since they
must always be on now.

For various security reasons, SMB3 and later are STRONGLY preferred
over CIFS and older dialects, and SMB3 (and later) will now be
the default dialects so we do not want to allow them to be
ifdeffed out.

In the longer term, we may be able to make older CIFS support
disableable in Kconfig with a new set of #ifdef, but we always
want SMB3 and later support enabled.

Signed-off-by: Steven French &lt;smfrench@gmail.com&gt;
Reviewed-by: Pavel Shilovsky &lt;pshilov@microsoft.com&gt;
</content>
</entry>
<entry>
<title>cifs: fix CIFS_IOC_GET_MNT_INFO oops</title>
<updated>2017-05-04T00:32:35Z</updated>
<author>
<name>David Disseldorp</name>
<email>ddiss@suse.de</email>
</author>
<published>2017-05-03T22:41:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=d8a6e505d6bba2250852fbc1c1c86fe68aaf9af3'/>
<id>urn:sha1:d8a6e505d6bba2250852fbc1c1c86fe68aaf9af3</id>
<content type='text'>
An open directory may have a NULL private_data pointer prior to readdir.

Fixes: 0de1f4c6f6c0 ("Add way to query server fs info for smb3")
Cc: stable@vger.kernel.org
Signed-off-by: David Disseldorp &lt;ddiss@suse.de&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>cifs: fix CIFS_ENUMERATE_SNAPSHOTS oops</title>
<updated>2017-05-03T14:59:20Z</updated>
<author>
<name>David Disseldorp</name>
<email>ddiss@suse.de</email>
</author>
<published>2017-05-03T15:39:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=6026685de33b0db5b2b6b0e9b41b3a1a3261033c'/>
<id>urn:sha1:6026685de33b0db5b2b6b0e9b41b3a1a3261033c</id>
<content type='text'>
As with 618763958b22, an open directory may have a NULL private_data
pointer prior to readdir. CIFS_ENUMERATE_SNAPSHOTS must check for this
before dereference.

Fixes: 834170c85978 ("Enable previous version support")
Signed-off-by: David Disseldorp &lt;ddiss@suse.de&gt;
CC: Stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
<entry>
<title>Do not return number of bytes written for ioctl CIFS_IOC_COPYCHUNK_FILE</title>
<updated>2017-04-28T12:56:33Z</updated>
<author>
<name>Sachin Prabhu</name>
<email>sprabhu@redhat.com</email>
</author>
<published>2017-04-26T16:10:17Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=7d0c234fd2e1c9ca3fa032696c0c58b1b74a9e0b'/>
<id>urn:sha1:7d0c234fd2e1c9ca3fa032696c0c58b1b74a9e0b</id>
<content type='text'>
commit 620d8745b35d ("Introduce cifs_copy_file_range()") changes the
behaviour of the cifs ioctl call CIFS_IOC_COPYCHUNK_FILE. In case of
successful writes, it now returns the number of bytes written. This
return value is treated as an error by the xfstest cifs/001. Depending
on the errno set at that time, this may or may not result in the test
failing.

The patch fixes this by setting the return value to 0 in case of
successful writes.

Fixes: commit 620d8745b35d ("Introduce cifs_copy_file_range()")
Reported-by: Eryu Guan &lt;eguan@redhat.com&gt;
Signed-off-by: Sachin Prabhu &lt;sprabhu@redhat.com&gt;
Acked-by: Pavel Shilovsky &lt;pshilov@microsoft.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Steve French &lt;smfrench@gmail.com&gt;
</content>
</entry>
</feed>
