28 Jun, 2015

1 commit

  • Parses and recognizes "vers=3.1.1" on cifs mount and allows sending
    0x0311 as a new CIFS/SMB3 dialect. Subsequent patches will add
    the new negotiate contexts and updated session setup

    Reviewed-by: Jeff Layton
    Signed-off-by: Steve French

    Steve French
     

26 Aug, 2014

1 commit


27 Jun, 2013

1 commit

  • SMB3 uses a much faster method of signing (which is also better in other ways),
    AES-CMAC. With the kernel now supporting AES-CMAC since last release, we
    are overdue to allow SMB3 signing (today only CIFS and SMB2 and SMB2.1,
    but not SMB3 and SMB3.1 can sign) - and we need this also for checking
    secure negotation and also per-share encryption (two other new SMB3 features
    which we need to implement).

    This patch needs some work in a few areas - for example we need to
    move signing for SMB2/SMB3 from per-socket to per-user (we may be able to
    use the "nosharesock" mount option in the interim for the multiuser case),
    and Shirish found a bug in the earlier authentication overhaul
    (setting signing flags properly) - but those can be done in followon
    patches.

    Signed-off-by: Shirish Pargaonkar
    Signed-off-by: Steve French

    Steve French
     

22 Jan, 2013

1 commit

  • The CONFIG_EXPERIMENTAL config item has not carried much meaning for a
    while now and is almost always enabled by default. As agreed during the
    Linux kernel summit, remove it from any "depends on" lines in Kconfigs.

    CC: Steve French
    CC: Al Viro
    Signed-off-by: Kees Cook
    Signed-off-by: Greg Kroah-Hartman

    Kees Cook
     

06 Dec, 2012

1 commit

  • This can reduce the size of the module by ~120KB which
    could be useful for embedded systems.

    $ size fs/cifs/built-in.o*
    text data bss dec hex filename
    388567 34459 100440 523466 7fcca fs/cifs/built-in.o.new
    495970 34599 117904 648473 9e519 fs/cifs/built-in.o.old

    Signed-off-by: Joe Perches
    Reviewed-by: Jeff Layton

    Joe Perches
     

02 Oct, 2012

1 commit

  • make menuconfig for cifs shows multiple entries toward
    the end of the list with the incorrect indentation
    (probably a bug in Kconfig parsing of items
    that are dependant on the module (cifs=m instead of
    just CONFIG_CIFS). This patch fixes the indentation
    of all but the last entry (CIFS_ACL) which I don't
    know how to fix. It also clarifies wording in
    two places

    Reviewed-by: Jeff Layton
    Signed-off-by: Steve French

    Steve French
     

25 Sep, 2012

2 commits

  • Now that the merge of the remaining pieces needed for
    SMB2 (SMB2.1 dialect) are in, and most test cases pass,
    we can consider SMB2.1 EXPERIMENTAL rather than "BROKEN."

    Reviewed-by: Jeff Layton
    Reviewed-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Steve French
     
  • 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
    Signed-off-by: Sachin Prabhu
    Signed-off-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Pavel Shilovsky
     

23 May, 2012

1 commit

  • SMB2 is the followon to the CIFS (and SMB) protocols
    and the default for Windows since Windows Vista, and also
    now implemented by various non-Windows servers. SMB2
    is more secure, has various performance advantages, including
    larger i/o sizes, flow control, better caching model and more.
    SMB2 also resolves some scalability limits in the CIFS
    protocol and adds many new features while being much
    simpler (only a few dozen commands instead of hundreds)
    and since the protocol is clearer it is also more consistently
    implemented across servers and thus easier to optimize.

    After much discussion with Jeff Layton, Jeremy Allison
    and others at Connectathon, we decided to move the SMB2
    code from a distinct .ko and fstype into distinct
    C files that optionally build in cifs.ko. As a result
    the Kconfig gets simpler.

    To avoid destabilizing CIFS, the SMB2 code is going
    to be moved into its own experimental CONFIG_CIFS_SMB2 ifdef
    as it is merged and rereviewed. The changes to stable
    CIFS (builds with the SMB2 ifdef off) are expected to be
    fairly small.

    Reviewed-by: Jeff Layton
    Signed-off-by: Steve French
    Signed-off-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Steve French
     

01 Feb, 2012

1 commit


19 Jan, 2012

1 commit


25 Jun, 2011

1 commit

  • This does not work properly with CIFS as current servers do not
    enable support for the FILE_OPEN_BY_FILE_ID on SMB NTCreateX
    and not all NFS clients handle ESTALE.

    For now, it just plain doesn't work. Mark it BROKEN to discourage
    distros from enabling it.

    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

07 Jun, 2011

1 commit


04 Jun, 2011

1 commit

  • When CONFIG_CRYPTO_ECB is not set, trying to mount a CIFS share with NTLM
    security resulted in mount failure with the following error:
    "CIFS VFS: could not allocate des crypto API"

    Seems like a leftover from commit 43988d7.

    Signed-off-by: Suresh Jayaraman
    CC: Shirish Pargaonkar
    Reviewed-by: Jeff Layton
    Signed-off-by: Steve French

    Suresh Jayaraman
     

24 May, 2011

1 commit


19 May, 2011

3 commits

  • local cifs functions (repost)

    Using kernel crypto APIs for DES encryption during LM and NT hash generation
    instead of local functions within cifs.
    Source file smbdes.c is deleted sans four functions, one of which
    uses ecb des functionality provided by kernel crypto APIs.

    Remove function SMBOWFencrypt.

    Add return codes to various functions such as calc_lanman_hash,
    SMBencrypt, and SMBNTencrypt. Includes fix noticed by Dan Carpenter.

    Signed-off-by: Shirish Pargaonkar
    CC: Dan Carpenter
    Acked-by: Jeff Layton
    Signed-off-by: Steve French

    Steve French
     
  • Remove config flag CIFS_EXPERIMENTAL.
    Do export operations under new config flag CIFS_NFSD_EXPORT

    Signed-off-by: Shirish Pargaonkar
    Reviewed-by: Jeff Layton
    Signed-off-by: Steve French

    Shirish Pargaonkar
     
  • SMB2 is the followon to the CIFS (and SMB) protocols
    and the default for Windows since Windows Vista, and also
    now implemented by various non-Windows servers. SMB2
    is more secure, has various performance advantages, including
    larger i/o sizes, flow control, better caching model and more.
    SMB2 also resolves some scalability limits in the cifs
    protocol and adds many new features while being much
    simpler (only a few dozen commands instead of hundreds)
    and since the protocol is clearer it is
    also more consistently implemented across servers
    and thus easier to optimize.

    After much discussion with Jeff Layton, Jeremy Allison
    and others at Connectathon, we decided to move the smb2
    code from a distinct .ko and fstype into distinct
    C files that optionally build in cifs.ko. As a result
    the Kconfig gets simpler.

    To avoid destabilizing cifs, the smb2 code is going
    to be moved into its own experimental CONFIG_CIFS_SMB2 ifdef
    as it is merged and rereviewed. The changes to stable
    cifs (builds with the smb2 ifdef off) are expected to be
    fairly small.

    Reviewed-by: Jeff Layton
    Signed-off-by: Steve French

    Steve French
     

31 Jan, 2011

1 commit

  • Recently CIFS was changed to use the kernel crypto API for MD4 hashes,
    but the Kconfig dependencies were not changed to reflect this.

    Signed-off-by: Jeff Layton
    Reported-and-Tested-by: Suresh Jayaraman
    Reviewed-by: Shirish Pargaonkar
    Signed-off-by: Steve French

    Jeff Layton
     

30 Nov, 2010

1 commit


14 Nov, 2010

1 commit

  • linux-2.6.37-rc1: I compiled a kernel with CIFS which subsequently
    failed with an error indicating it couldn't initialize crypto module
    "hmacmd5". CONFIG_CRYPTO_HMAC=y fixed the problem.

    This patch makes CIFS depend on CRYPTO_HMAC in kconfig.

    Signed-off-by: Jody Bruchon
    CC: Shirish Pargaonkar
    Signed-off-by: Steve French

    Steve French
     

27 Oct, 2010

1 commit

  • Mark dependency on crypto modules in Kconfig.

    Defining per structures sdesc and cifs_secmech which are used to store
    crypto hash functions and contexts. They are stored per smb connection
    and used for all auth mechs to genereate hash values and signatures.

    Allocate crypto hashing functions, security descriptiors, and respective
    contexts when a smb/tcp connection is established.
    Release them when a tcp/smb connection is taken down.

    md5 and hmac-md5 are two crypto hashing functions that are used
    throught the life of an smb/tcp connection by various functions that
    calcualte signagure and ntlmv2 hash, HMAC etc.

    structure ntlmssp_auth is defined as per smb connection.

    ntlmssp_auth holds ciphertext which is genereated by rc4/arc4 encryption of
    secondary key, a nonce using ntlmv2 session key and sent in the session key
    field of the type 3 message sent by the client during ntlmssp
    negotiation/exchange

    A key is exchanged with the server if client indicates so in flags in
    type 1 messsage and server agrees in flag in type 2 message of ntlmssp
    negotiation. If both client and agree, a key sent by client in
    type 3 message of ntlmssp negotiation in the session key field.
    The key is a ciphertext generated off of secondary key, a nonce, using
    ntlmv2 hash via rc4/arc4.

    Signing works for ntlmssp in this patch. The sequence number within
    the server structure needs to be zero until session is established
    i.e. till type 3 packet of ntlmssp exchange of a to be very first
    smb session on that smb connection is sent.

    Acked-by: Jeff Layton
    Signed-off-by: Shirish Pargaonkar
    Signed-off-by: Steve French

    Shirish Pargaonkar
     

09 Sep, 2010

1 commit

  • This reverts commit 9fbc590860e75785bdaf8b83e48fabfe4d4f7d58.

    The change to kernel crypto and fixes to ntlvm2 and ntlmssp
    series, introduced a regression. Deferring this patch series
    to 2.6.37 after Shirish fixes it.

    Signed-off-by: Steve French
    Acked-by: Jeff Layton
    CC: Shirish Pargaonkar

    Steve French
     

21 Aug, 2010

1 commit

  • Make ntlmv2 as an authentication mechanism within ntlmssp
    instead of ntlmv1.
    Parse type 2 response in ntlmssp negotiation to pluck
    AV pairs and use them to calculate ntlmv2 response token.
    Also, assign domain name from the sever response in type 2
    packet of ntlmssp and use that (netbios) domain name in
    calculation of response.

    Enable cifs/smb signing using rc4 and md5.

    Changed name of the structure mac_key to session_key to reflect
    the type of key it holds.

    Use kernel crypto_shash_* APIs instead of the equivalent cifs functions.

    Signed-off-by: Shirish Pargaonkar
    Acked-by: Herbert Xu
    Signed-off-by: Steve French

    Steve French
     

08 Aug, 2010

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
    [DNS RESOLVER] Minor typo correction
    DNS: Fixes for the DNS query module
    cifs: Include linux/err.h for IS_ERR and PTR_ERR
    DNS: Make AFS go to the DNS for AFSDB records for unknown cells
    DNS: Separate out CIFS DNS Resolver code
    cifs: account for new creduid=0x%x parameter in spnego upcall string
    cifs: reduce false positives with inode aliasing serverino autodisable
    CIFS: Make cifs_convert_address() take a const src pointer and a length
    cifs: show features compiled in as part of DebugData
    cifs: update README

    Fix up trivial conflicts in fs/cifs/cifsfs.c due to workqueue changes

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (55 commits)
    workqueue: mark init_workqueues() as early_initcall()
    workqueue: explain for_each_*cwq_cpu() iterators
    fscache: fix build on !CONFIG_SYSCTL
    slow-work: kill it
    gfs2: use workqueue instead of slow-work
    drm: use workqueue instead of slow-work
    cifs: use workqueue instead of slow-work
    fscache: drop references to slow-work
    fscache: convert operation to use workqueue instead of slow-work
    fscache: convert object to use workqueue instead of slow-work
    workqueue: fix how cpu number is stored in work->data
    workqueue: fix mayday_mask handling on UP
    workqueue: fix build problem on !CONFIG_SMP
    workqueue: fix locking in retry path of maybe_create_worker()
    async: use workqueue for worker pool
    workqueue: remove WQ_SINGLE_CPU and use WQ_UNBOUND instead
    workqueue: implement unbound workqueue
    workqueue: prepare for WQ_UNBOUND implementation
    libata: take advantage of cmwq and remove concurrency limitations
    workqueue: fix worker management invocation without pending works
    ...

    Fixed up conflicts in fs/cifs/* as per Tejun. Other trivial conflicts in
    include/linux/workqueue.h, kernel/trace/Kconfig and kernel/workqueue.c

    Linus Torvalds
     

06 Aug, 2010

1 commit

  • Separate out the DNS resolver key type from the CIFS filesystem into its own
    module so that it can be made available for general use, including the AFS
    filesystem module.

    This facility makes it possible for the kernel to upcall to userspace to have
    it issue DNS requests, package up the replies and present them to the kernel
    in a useful form. The kernel is then able to cache the DNS replies as keys
    can be retained in keyrings.

    Resolver keys are of type "dns_resolver" and have a case-insensitive
    description that is of the form "[:]". The optional
    indicates the particular DNS lookup and packaging that's required. The
    is the query to be made.

    If isn't given, a basic hostname to IP address lookup is made, and the
    result is stored in the key in the form of a printable string consisting of a
    comma-separated list of IPv4 and IPv6 addresses.

    This key type is supported by userspace helpers driven from /sbin/request-key
    and configured through /etc/request-key.conf. The cifs.upcall utility is
    invoked for UNC path server name to IP address resolution.

    The CIFS functionality is encapsulated by the dns_resolve_unc_to_ip() function,
    which is used to resolve a UNC path to an IP address for CIFS filesystem. This
    part remains in the CIFS module for now.

    See the added Documentation/networking/dns_resolver.txt for more information.

    Signed-off-by: Wang Lei
    Signed-off-by: David Howells
    Acked-by: Jeff Layton
    Signed-off-by: Steve French

    Wang Lei
     

02 Aug, 2010

1 commit


23 Jul, 2010

1 commit

  • Workqueue can now handle high concurrency. Use system_nrt_wq
    instead of slow-work.

    * Updated is_valid_oplock_break() to not call cifs_oplock_break_put()
    as advised by Steve French. It might cause deadlock. Instead,
    reference is increased after queueing succeeded and
    cifs_oplock_break() briefly grabs GlobalSMBSeslock before putting
    the cfile to make sure it doesn't put before the matching get is
    finished.

    * Anton Blanchard reported that cifs conversion was using now gone
    system_single_wq. Use system_nrt_wq which provides non-reentrance
    guarantee which is enough and much better.

    Signed-off-by: Tejun Heo
    Acked-by: Steve French
    Cc: Anton Blanchard

    Tejun Heo
     

25 Sep, 2009

1 commit

  • This is the fourth respin of the patch to convert oplock breaks to
    use the slow_work facility.

    A customer of ours was testing a backport of one of the earlier
    patchsets, and hit a "Busy inodes after umount..." problem. An oplock
    break job had raced with a umount, and the superblock got torn down and
    its memory reused. When the oplock break job tried to dereference the
    inode->i_sb, the kernel oopsed.

    This patchset has the oplock break job hold an inode and vfsmount
    reference until the oplock break completes. With this, there should be
    no need to take a tcon reference (the vfsmount implicitly holds one
    already).

    Currently, when an oplock break comes in there's a chance that the
    oplock break job won't occur if the allocation of the oplock_q_entry
    fails. There are also some rather nasty races in the allocation and
    handling these structs.

    Rather than allocating oplock queue entries when an oplock break comes
    in, add a few extra fields to the cifsFileInfo struct. Get rid of the
    dedicated cifs_oplock_thread as well and queue the oplock break job to
    the slow_work thread pool.

    This approach also has the advantage that the oplock break jobs can
    potentially run in parallel rather than be serialized like they are
    today.

    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

12 Mar, 2009

1 commit


20 Oct, 2008

1 commit