summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2proto.h
Commit message (Collapse)AuthorAgeFilesLines
* mfsymlinks support for SMB2.1/SMB3. Part 2 query symlinkSteve French2014-10-161-0/+4
| | | | | | | | | | | | | Adds support on SMB2.1 and SMB3 mounts for emulation of symlinks via the "Minshall/French" symlink format already used for cifs mounts when mfsymlinks mount option is used (and also used by Apple). http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks This second patch adds support to query them (recognize them as symlinks and read them). Third version of patch makes minor corrections to error handling. Signed-off-by: Steve French <smfrench@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Add mfsymlinks support for SMB2.1/SMB3. Part 1 create symlinkSteve French2014-10-161-1/+3
| | | | | | | | | | | | | | | | | Adds support on SMB2.1 and SMB3 mounts for emulation of symlinks via the "Minshall/French" symlink format already used for cifs mounts when mfsymlinks mount option is used (and also used by Apple). http://wiki.samba.org/index.php/UNIX_Extensions#Minshall.2BFrench_symlinks This first patch adds support to create them. The next patch will add support for recognizing them and reading them. Although CIFS/SMB3 have other types of symlinks, in the many use cases they aren't practical (e.g. either require cifs only mounts with unix extensions to Samba, or require the user to be Administrator to Windows for SMB3). This also helps enable running additional xfstests over SMB3 (since some xfstests directly or indirectly require symlink support). Signed-off-by: Steve French <smfrench@gmail.com> CC: Stefan Metzmacher <metze@samba.org>
* Add worker function to set allocation sizeSteve French2014-08-051-1/+1
| | | | | | | Adds setinfo worker function for SMB2/SMB3 support of SET_ALLOCATION_INFORMATION Signed-off-by: Steve French <smfrench@gmail.com> Reviewed-by: Pavel Shilovsky <pshilovsky@samba.org>
* [CIFS] clean up page array when uncached write send failsSteve French2014-02-071-1/+2
| | | | | | | | | | | | | | | In the event that a send fails in an uncached write, or we end up needing to reissue it (-EAGAIN case), we'll kfree the wdata but the pages currently leak. Fix this by adding a new kref release routine for uncached writedata that releases the pages, and have the uncached codepaths use that. [original patch by Jeff modified to fix minor formatting problems] Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
* Check SMB3 dialects against downgrade attacksSteve French2013-11-191-0/+1
| | | | | | | | | | | | | | | | | | | | | When we are running SMB3 or SMB3.02 connections which are signed we need to validate the protocol negotiation information, to ensure that the negotiate protocol response was not tampered with. Add the missing FSCTL which is sent at mount time (immediately after the SMB3 Tree Connect) to validate that the capabilities match what we think the server sent. "Secure dialect negotiation is introduced in SMB3 to protect against man-in-the-middle attempt to downgrade dialect negotiation. The idea is to prevent an eavesdropper from downgrading the initially negotiated dialect and capabilities between the client and the server." For more explanation see 2.2.31.4 of MS-SMB2 or http://blogs.msdn.com/b/openspecification/archive/2012/06/28/smb3-secure-dialect-negotiation.aspx Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Fix symbolic links usagePavel Shilovsky2013-11-111-1/+1
| | | | | | | | | | | | | | | | | | | 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: <stable@vger.kernel.org> Acked-by: Jeff Layton <jlayton@redhat.com> Reported-and-tested-by: Joao Correia <joaomiguelcorreia@gmail.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
* Query device characteristics at mount time from server on SMB2/3 not just on ↵Steven French2013-11-021-1/+1
| | | | | | | | | | | | cifs mounts Currently SMB2 and SMB3 mounts do not query the device information at mount time from the server as is done for cifs. These can be useful for debugging. This is a minor patch, that extends the previous one (which added ability to query file system attributes at mount time - this returns the device characteristics - also via in /proc/fs/cifs/DebugData) Signed-off-by: Steve French <smfrench@gmail.com>
* Query file system attributes from server on SMB2, not just cifs, mountsSteve French2013-10-281-0/+2
| | | | | | | Currently SMB2 and SMB3 mounts do not query the file system attributes from the server at mount time as is done for cifs. These can be useful for debugging. Signed-off-by: Steve French <smfrench@gmail.com>
* Allow setting per-file compression via SMB2/3Steve French2013-10-281-0/+2
| | | | | | | | | | | | | Allow cifs/smb2/smb3 to return whether or not a file is compressed via lsattr, and allow SMB2/SMB3 to set the per-file compression flag ("chattr +c filename" on an smb3 mount). Windows users often set the compressed flag (it can be done from the desktop and file manager). David Disseldorp has patches to Samba server to support this (at least on btrfs) which are complementary to this Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Store lease state itself rather than a mapped oplock valuePavel Shilovsky2013-09-091-2/+0
| | | | | | | and separate smb20_operations struct. Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Implement follow_link for SMB2Pavel Shilovsky2013-09-081-1/+2
| | | | | | | | that allows to access files through symlink created on a server. Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Make SMB2_open use cifs_open_parms structPavel Shilovsky2013-07-101-4/+2
| | | | | | | to prepare it for further durable handle reconnect processing. Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steven French <steven@steven-GA-970A-DS3.(none)>
* CIFS: Introduce cifs_open_parms structPavel Shilovsky2013-07-101-5/+3
| | | | | | | and pass it to the open() call. Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steven French <steven@steven-GA-970A-DS3.(none)>
* CIFS: Respect create_options in smb2_open_filePavel Shilovsky2013-07-101-2/+2
| | | | | | | and eliminated unused file_attribute parms of SMB2_open. Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steven French <steven@steven-GA-970A-DS3.(none)>
* SMB2 FSCTL and IOCTL worker functionSteve French2013-06-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | This worker function is needed to send SMB2 fsctl (and ioctl) requests including: validating negotiation info (secure negotiate) querying the servers network interfaces copy offload (refcopy) Followon patches for the above three will use this. This patch also does general validation of the response. In the future, as David Disseldorp notes, for the copychunk ioctl case, we will want to enhance the response processing to allow returning the chunk request limits to the caller (even though the server returns an error, in that case we would return data that the caller could use - see 2.2.32.1). See MS-SMB2 Section 2.2.31 for more details on format of fsctl. Acked-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
* Do not send SMB2 signatures for SMB3 framesSteve French2012-12-091-0/+4
| | | | | | | | | | | Restructure code to make SMB2 vs. SMB3 signing a protocol specific op. SMB3 signing (AES_CMAC) is not enabled yet, but this restructuring at least makes sure we don't send an smb2 signature on an smb3 signed connection. A followon patch will add AES_CMAC and enable smb3 signing. Signed-off-by: Steve French <smfrench@gmail.com> Acked-by: Jeff Layton <jlayton@samba.org>
* CIFS: Add SMB2.1 lease break supportPavel Shilovsky2012-09-241-0/+4
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <sfrench@us.ibm.com>
* CIFS: Use brlock cache for SMB2Pavel Shilovsky2012-09-241-0/+1
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
* CIFS: Add brlock support for SMB2Pavel Shilovsky2012-09-241-0/+10
| | | | Signed-off-by: Pavel Shilovsky <pshilovsky@etersoft.ru>
* cifs: change cifs_call_async to use smb_rqst structsJeff Layton2012-09-241-5/+4
| | | | | | | | | | | For now, none of the callers populate rq_pages. That will be done for writes in a later patch. While we're at it, change the prototype of setup_async_request not to need a return pointer argument. Just return the pointer to the mid_q_entry or an ERR_PTR. Reviewed-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
* cifs: change smb2 signing routines to use smb_rqst structsJeff Layton2012-09-241-2/+2
| | | | | Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add statfs support for SMB2Pavel Shilovsky2012-09-241-0/+3
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add oplock break support for SMB2Pavel Shilovsky2012-09-241-0/+5
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Process oplocks for SMB2Pavel Shilovsky2012-09-241-1/+2
| | | | | Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add readdir support for SMB2Pavel Shilovsky2012-09-241-1/+4
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add set_file_info support for SMB2Pavel Shilovsky2012-09-241-0/+5
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add SMB2 support for set_file_sizePavel Shilovsky2012-09-241-0/+6
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add SMB2 support for hardlink operationPavel Shilovsky2012-09-241-0/+6
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add SMB2 support for rename operationPavel Shilovsky2012-09-241-0/+6
| | | | | Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Enable signing in SMB2Pavel Shilovsky2012-09-241-0/+2
| | | | | | | | | | | | | | Use hmac-sha256 and rather than hmac-md5 that is used for CIFS/SMB. Signature field in SMB2 header is 16 bytes instead of 8 bytes. Automatically enable signing by client when requested by the server when signing ability is available to the client. Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add writepage support for SMB2Pavel Shilovsky2012-09-241-0/+2
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add readpage support for SMB2Pavel Shilovsky2012-09-241-0/+2
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add SMB2 support for cifs_iovec_writePavel Shilovsky2012-09-241-0/+1
| | | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
* CIFS: Add SMB2 support for cifs_iovec_readPavel Shilovsky2012-09-241-0/+1
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add SMB2 support for flushPavel Shilovsky2012-09-241-0/+2
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add open/close file support for SMB2Pavel Shilovsky2012-09-241-1/+13
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add SMB2 support for unlinkPavel Shilovsky2012-09-241-0/+2
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add SMB2 support for rmdirPavel Shilovsky2012-07-271-0/+2
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add SMB2 support for mkdir operationPavel Shilovsky2012-07-271-0/+6
| | | | | Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add echo request support for SMB2Pavel Shilovsky2012-07-241-0/+1
| | | | | Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add SMB2 support for async requestsPavel Shilovsky2012-07-241-0/+4
| | | | | Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Query SMB2 inode infoPavel Shilovsky2012-07-241-0/+7
| | | | | Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add SMB2 support for is_path_accessiblePavel Shilovsky2012-07-241-0/+8
| | | | | | | that needs for a successful mount through SMB2 protocol. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add tree connect/disconnect capability for SMB2Pavel Shilovsky2012-07-241-0/+4
| | | | | Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add session setup/logoff capability for SMB2Pavel Shilovsky2012-07-241-0/+3
| | | | | Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Add capability to send SMB2 negotiate messagePavel Shilovsky2012-07-241-0/+7
| | | | | | | | | and add negotiate request type to let set_credits know that we are only on negotiate stage and no need to make a decision about disabling echos and oplocks. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Make demultiplex_thread work with SMB2 codePavel Shilovsky2012-07-241-0/+2
| | | | | | | | Now we can process SMB2 messages: check message, get message id and wakeup awaiting routines. Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Make transport routines work with SMB2Pavel Shilovsky2012-07-241-0/+5
| | | | | | Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
* CIFS: Map SMB2 status codes to POSIX errorsSteve French2012-07-241-0/+37
Add mapping table for 32 bit SMB2 status codes to linux errors. Note that SMB2 does not use DOS/OS2 errors (ever) so mapping to DOS/OS2 errors as a common network subset (as we do for cifs) doesn't help. And note that the set of status codes is much more complete here. Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
OpenPOWER on IntegriCloud