01 Jun, 2020

1 commit

  • Use pr_fmt to standardize all logging for fs/cifs.

    Some logging output had no CIFS: specific prefix.

    Now all output has one of three prefixes:

    o CIFS:
    o CIFS: VFS:
    o Root-CIFS:

    Miscellanea:

    o Convert printks to pr_
    o Neaten macro definitions
    o Remove embedded CIFS: prefixes from formats
    o Convert "illegal" to "invalid"
    o Coalesce formats
    o Add missing '\n' format terminations
    o Consolidate multiple cifs_dbg continuations into single calls
    o More consistent use of upper case first word output logging
    o Multiline statement argument alignment and wrapping

    Signed-off-by: Joe Perches
    Signed-off-by: Steve French

    Joe Perches
     

20 Jun, 2019

1 commit

  • The CIFS code uses the sync skcipher API to invoke the ecb(arc4) skcipher,
    of which only a single generic C code implementation exists. This means
    that going through all the trouble of using scatterlists etc buys us
    very little, and we're better off just invoking the arc4 library directly.

    This also reverts commit 5f4b55699aaf ("CIFS: Fix BUG() in calc_seckey()"),
    since it is no longer necessary to allocate sec_key on the heap.

    Cc: linux-cifs@vger.kernel.org
    Cc: Steve French
    Signed-off-by: Ard Biesheuvel
    Acked-by: Steve French
    Signed-off-by: Herbert Xu

    Ard Biesheuvel
     

24 Dec, 2018

2 commits

  • password_with_pad is a fixed size buffer of 16 bytes, it contains a
    password string, to be padded with \0 if shorter than 16 bytes
    but is just truncated if longer.
    It is not, and we do not depend on it to be, nul terminated.

    As such, do not use strncpy() to populate this buffer since
    the str* prefix suggests that this is a string, which it is not,
    and it also confuses coverity causing a false warning.

    Detected by CoverityScan CID#113743 ("Buffer not null terminated")

    Signed-off-by: Ronnie Sahlberg
    Signed-off-by: Steve French

    Ronnie Sahlberg
     
  • Trivial fix to clean up indentation, replace spaces with tab

    Signed-off-by: Colin Ian King
    Signed-off-by: Steve French

    Colin Ian King
     

08 Aug, 2018

2 commits

  • Check if every data page is signed correctly in sigining helper.

    Signed-off-by: Paulo Alcantara
    Reviewed-by: Ronnie Sahlberg
    Signed-off-by: Steve French

    Paulo Alcantara
     
  • In cifs, the timestamps are stored in memory in the cifs_fattr structure,
    which uses the deprecated 'timespec' structure. Now that the VFS code
    has moved on to 'timespec64', the next step is to change over the fattr
    as well.

    This also makes 32-bit and 64-bit systems behave the same way, and
    no longer overflow the 32-bit time_t in year 2038.

    Signed-off-by: Arnd Bergmann
    Reviewed-by: Paulo Alcantara
    Signed-off-by: Steve French

    Arnd Bergmann
     

16 Jun, 2018

1 commit


15 Jun, 2018

1 commit


06 Jun, 2018

1 commit


05 Jun, 2018

1 commit

  • It seems Ronnie's preamble removal broke signing.

    the signing functions are called when:

    A) we send a request (to sign it)
    B) when we recv a response (to check the signature).

    On code path A, the smb2 header is in iov[1] but on code path B, the
    smb2 header is in iov[0] (and there's only one vector).

    So we have different iov indexes for the smb2 header but the signing
    function always use index 1. Fix this by checking the nb of io vectors
    in the signing function as a hint.

    Signed-off-by: Aurelien Aptel
    Reviewed-by: Ronnie Sahlberg
    Signed-off-by: Steve French

    Aurelien Aptel
     

02 Apr, 2018

3 commits

  • It seems this is a copy-paste error and that the proper variable to use
    in this particular case is _sha512_ instead of _md5_.

    Addresses-Coverity-ID: 1465358 ("Copy-paste error")
    Fixes: 1c6614d229e7 ("CIFS: add sha512 secmech")
    Signed-off-by: Gustavo A. R. Silva
    Reviewed-by: Aurelien Aptel
    CC: Stable
    Signed-off-by: Steve French

    Gustavo A. R. Silva
     
  • * prepare for SMB3.11 pre-auth integrity
    * enable sha512 when SMB311 is enabled in Kconfig
    * add sha512 as a soft dependency

    Signed-off-by: Aurelien Aptel
    Signed-off-by: Steve French
    CC: Stable
    Reviewed-by: Ronnie Sahlberg

    Aurelien Aptel
     
  • 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
    Signed-off-by: Steve French
    Reviewed-by: Ronnie Sahlberg
    CC: Stable

    Aurelien Aptel
     

27 Jan, 2018

1 commit


09 May, 2017

1 commit

  • CURRENT_TIME macro is not y2038 safe on 32 bit systems.

    The patch replaces all the uses of CURRENT_TIME by current_time() for
    filesystem times, and ktime_get_* functions for authentication
    timestamps and timezone calculations.

    This is also in preparation for the patch that transitions vfs
    timestamps to use 64 bit time and hence make them y2038 safe.

    CURRENT_TIME macro will be deleted before merging the aforementioned
    change.

    The inode timestamps read from the server are assumed to have correct
    granularity and range.

    The patch also assumes that the difference between server and client
    times lie in the range INT_MIN..INT_MAX. This is valid because this is
    the difference between current times between server and client, and the
    largest timezone difference is in the range of one day.

    All cifs timestamps currently use timespec representation internally.
    Authentication and timezone timestamps can also be transitioned into
    using timespec64 when all other timestamps for cifs is transitioned to
    use timespec64.

    Link: http://lkml.kernel.org/r/1491613030-11599-4-git-send-email-deepa.kernel@gmail.com
    Signed-off-by: Deepa Dinamani
    Reviewed-by: Arnd Bergmann
    Cc: Steve French
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Deepa Dinamani
     

02 Feb, 2017

2 commits


15 Dec, 2016

1 commit

  • With commit 2b149f119 many things have been fixed/introduced.
    However, the default behaviour for RawNTLMSSP authentication
    seems to be wrong in case the domain is not passed on the command line.

    The main points (see below) of the patch are:
    - It alignes behaviour with Windows clients
    - It fixes backward compatibility
    - It fixes UPN

    I compared this behavour with the one from a Windows 10 command line
    client. When no domains are specified on the command line, I traced
    the packets and observed that the client does send an empty
    domain to the server.
    In the linux kernel case, the empty domain is replaced by the
    primary domain communicated by the SMB server.
    This means that, if the credentials are valid against the local server
    but that server is part of a domain, then the kernel module will
    ask to authenticate against that domain and we will get LOGON failure.

    I compared the packet trace from the smbclient when no domain is passed
    and, in that case, a default domain from the client smb.conf is taken.
    Apparently, connection succeeds anyway, because when the domain passed
    is not valid (in my case WORKGROUP), then the local one is tried and
    authentication succeeds. I tried with any kind of invalid domain and
    the result was always a connection.

    So, trying to interpret what to do and picking a valid domain if none
    is passed, seems the wrong thing to do.
    To this end, a new option "domainauto" has been added in case the
    user wants a mechanism for guessing.

    Without this patch, backward compatibility also is broken.
    With kernel 3.10, the default auth mechanism was NTLM.
    One of our testing servers accepted NTLM and, because no
    domains are passed, authentication was local.

    Moving to RawNTLMSSP forced us to change our command line
    to add a fake domain to pass to prevent this mechanism to kick in.

    For the same reasons, UPN is broken because the domain is specified
    in the username.
    The SMB server will work out the domain from the UPN and authenticate
    against the right server.
    Without the patch, though, given the domain is empty, it gets replaced
    with another domain that could be the wrong one for the authentication.

    Signed-off-by: Germano Percossi
    Acked-by: Pavel Shilovsky
    Signed-off-by: Steve French

    Germano Percossi
     

29 Nov, 2016

1 commit

  • Andy Lutromirski's new virtually mapped kernel stack allocations moves
    kernel stacks the vmalloc area. This triggers the bug
    kernel BUG at ./include/linux/scatterlist.h:140!
    at calc_seckey()->sg_init()

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

    Sachin Prabhu
     

20 Jul, 2016

1 commit

  • The secmech hmac(md5) structures are present in the TCP_Server_Info
    struct and can be shared among multiple CIFS sessions. However, the
    server mutex is not currently held when these structures are allocated
    and used, which can lead to a kernel crashes, as in the scenario below:

    mount.cifs(8) #1 mount.cifs(8) #2

    Is secmech.sdeschmaccmd5 allocated?
    // false

    Is secmech.sdeschmaccmd5 allocated?
    // false

    secmech.hmacmd = crypto_alloc_shash..
    secmech.sdeschmaccmd5 = kzalloc..
    sdeschmaccmd5->shash.tfm = &secmec.hmacmd;

    secmech.sdeschmaccmd5 = kzalloc
    // sdeschmaccmd5->shash.tfm
    // not yet assigned

    crypto_shash_update()
    deref NULL sdeschmaccmd5->shash.tfm

    Unable to handle kernel paging request at virtual address 00000030
    epc : 8027ba34 crypto_shash_update+0x38/0x158
    ra : 8020f2e8 setup_ntlmv2_rsp+0x4bc/0xa84
    Call Trace:
    crypto_shash_update+0x38/0x158
    setup_ntlmv2_rsp+0x4bc/0xa84
    build_ntlmssp_auth_blob+0xbc/0x34c
    sess_auth_rawntlmssp_authenticate+0xac/0x248
    CIFS_SessSetup+0xf0/0x178
    cifs_setup_session+0x4c/0x84
    cifs_get_smb_ses+0x2c8/0x314
    cifs_mount+0x38c/0x76c
    cifs_do_mount+0x98/0x440
    mount_fs+0x20/0xc0
    vfs_kern_mount+0x58/0x138
    do_mount+0x1e8/0xccc
    SyS_mount+0x88/0xd4
    syscall_common+0x30/0x54

    Fix this by locking the srv_mutex around the code which uses these
    hmac(md5) structures. All the other secmech algos already have similar
    locking.

    Fixes: 95dc8dd14e2e84cc ("Limit allocation of crypto mechanisms to dialect which requires")
    Signed-off-by: Rabin Vincent
    Acked-by: Sachin Prabhu
    CC: Stable
    Signed-off-by: Steve French

    Rabin Vincent
     

29 Mar, 2016

1 commit


18 Mar, 2016

1 commit

  • Pull crypto update from Herbert Xu:
    "Here is the crypto update for 4.6:

    API:
    - Convert remaining crypto_hash users to shash or ahash, also convert
    blkcipher/ablkcipher users to skcipher.
    - Remove crypto_hash interface.
    - Remove crypto_pcomp interface.
    - Add crypto engine for async cipher drivers.
    - Add akcipher documentation.
    - Add skcipher documentation.

    Algorithms:
    - Rename crypto/crc32 to avoid name clash with lib/crc32.
    - Fix bug in keywrap where we zero the wrong pointer.

    Drivers:
    - Support T5/M5, T7/M7 SPARC CPUs in n2 hwrng driver.
    - Add PIC32 hwrng driver.
    - Support BCM6368 in bcm63xx hwrng driver.
    - Pack structs for 32-bit compat users in qat.
    - Use crypto engine in omap-aes.
    - Add support for sama5d2x SoCs in atmel-sha.
    - Make atmel-sha available again.
    - Make sahara hashing available again.
    - Make ccp hashing available again.
    - Make sha1-mb available again.
    - Add support for multiple devices in ccp.
    - Improve DMA performance in caam.
    - Add hashing support to rockchip"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (116 commits)
    crypto: qat - remove redundant arbiter configuration
    crypto: ux500 - fix checks of error code returned by devm_ioremap_resource()
    crypto: atmel - fix checks of error code returned by devm_ioremap_resource()
    crypto: qat - Change the definition of icp_qat_uof_regtype
    hwrng: exynos - use __maybe_unused to hide pm functions
    crypto: ccp - Add abstraction for device-specific calls
    crypto: ccp - CCP versioning support
    crypto: ccp - Support for multiple CCPs
    crypto: ccp - Remove check for x86 family and model
    crypto: ccp - memset request context to zero during import
    lib/mpi: use "static inline" instead of "extern inline"
    lib/mpi: avoid assembler warning
    hwrng: bcm63xx - fix non device tree compatibility
    crypto: testmgr - allow rfc3686 aes-ctr variants in fips mode.
    crypto: qat - The AE id should be less than the maximal AE number
    lib/mpi: Endianness fix
    crypto: rockchip - add hash support for crypto engine in rk3288
    crypto: xts - fix compile errors
    crypto: doc - add skcipher API documentation
    crypto: doc - update AEAD AD handling
    ...

    Linus Torvalds
     

11 Feb, 2016

1 commit


27 Jan, 2016

1 commit


23 Sep, 2015

1 commit

  • Linux cifs mount with ntlmssp against an Mac OS X (Yosemite
    10.10.5) share fails in case the clocks differ more than +/-2h:

    digest-service: digest-request: od failed with 2 proto=ntlmv2
    digest-service: digest-request: kdc failed with -1561745592 proto=ntlmv2

    Fix this by (re-)using the given server timestamp for the
    ntlmv2 authentication (as Windows 7 does).

    A related problem was also reported earlier by Namjae Jaen (see below):

    Windows machine has extended security feature which refuse to allow
    authentication when there is time difference between server time and
    client time when ntlmv2 negotiation is used. This problem is prevalent
    in embedded enviornment where system time is set to default 1970.

    Modern servers send the server timestamp in the TargetInfo Av_Pair
    structure in the challenge message [see MS-NLMP 2.2.2.1]
    In [MS-NLMP 3.1.5.1.2] it is explicitly mentioned that the client must
    use the server provided timestamp if present OR current time if it is
    not

    Reported-by: Namjae Jeon
    Signed-off-by: Peter Seiderer
    Signed-off-by: Steve French
    CC: Stable

    Peter Seiderer
     

01 Apr, 2015

1 commit


17 Oct, 2014

1 commit

  • This allows directory listings to Mac to display filenames
    correctly which have been created with illegal (to Windows)
    characters in their filename. It does not allow
    converting the other direction yet ie opening files with
    these characters (followon patch).

    There are seven reserved characters that need to be remapped when
    mounting to Windows, Mac (or any server without Unix Extensions) which
    are valid in POSIX but not in the other OS.

    : \ < > ? * |

    We used the normal UCS-2 remap range for this in order to convert this
    to/from UTF8 as did Windows Services for Unix (basically add 0xF000 to
    any of the 7 reserved characters), at least when the "mapchars" mount
    option was specified.

    Mac used a very slightly different "Services for Mac" remap range
    0xF021 through 0xF027. The attached patch allows cifs.ko (the kernel
    client) to read directories on macs containing files with these
    characters and display their names properly. In theory this even
    might be useful on mounts to Samba when the vfs_catia or new
    "vfs_fruit" module is loaded.

    Currently the 7 reserved characters look very strange in directory
    listings from cifs.ko to Mac server. This patch allows these file
    name characters to be read (requires specifying mapchars on mount).

    Two additional changes are needed:
    1) Make it more automatic: a way of detecting enough info so that
    we know to try to always remap these characters or not. Various
    have suggested that the SFM approach be made the default when
    the server does not support POSIX Unix extensions (cifs mounts
    to Samba for example) so need to make SFM remapping the default
    unless mapchars (SFU style mapping) specified on mount or no
    mapping explicitly requested or no mapping needed (cifs mounts to Samba).

    2) Adding a patch to map the characters the other direction
    (ie UTF-8 to UCS-2 on open). This patch does it for translating
    readdir entries (ie UCS-2 to UTF-8)

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

    Steve French
     

12 Nov, 2013

1 commit

  • A bit of cleanup plus some gratuitous variable renaming. I think using
    structures instead of numeric offsets makes this code much more
    understandable.

    Also added a comment about current time range expected by
    the server.

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

    Tim Gardner
     

01 Aug, 2013

1 commit

  • Jarod reported an Oops like when testing with fips=1:

    CIFS VFS: could not allocate crypto hmacmd5
    CIFS VFS: could not crypto alloc hmacmd5 rc -2
    CIFS VFS: Error -2 during NTLMSSP authentication
    CIFS VFS: Send error in SessSetup = -2
    BUG: unable to handle kernel NULL pointer dereference at 000000000000004e
    IP: [] crypto_destroy_tfm+0x1a/0x90
    PGD 0
    Oops: 0000 [#1] SMP
    Modules linked in: md4 nls_utf8 cifs dns_resolver fscache kvm serio_raw virtio_balloon virtio_net mperf i2c_piix4 cirrus drm_kms_helper ttm drm i2c_core virtio_blk ata_generic pata_acpi
    CPU: 1 PID: 639 Comm: mount.cifs Not tainted 3.11.0-0.rc3.git0.1.fc20.x86_64 #1
    Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    task: ffff88007bf496e0 ti: ffff88007b080000 task.ti: ffff88007b080000
    RIP: 0010:[] [] crypto_destroy_tfm+0x1a/0x90
    RSP: 0018:ffff88007b081d10 EFLAGS: 00010282
    RAX: 0000000000001f1f RBX: ffff880037422000 RCX: ffff88007b081fd8
    RDX: 000000000000001f RSI: 0000000000000006 RDI: fffffffffffffffe
    RBP: ffff88007b081d30 R08: ffff880037422000 R09: ffff88007c090100
    R10: 0000000000000000 R11: 00000000fffffffe R12: fffffffffffffffe
    R13: ffff880037422000 R14: ffff880037422000 R15: 00000000fffffffe
    FS: 00007fc322f4f780(0000) GS:ffff88007fc80000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 000000000000004e CR3: 000000007bdaa000 CR4: 00000000000006e0
    Stack:
    ffffffff81085845 ffff880037422000 ffff8800375e7400 ffff880037422000
    ffff88007b081d48 ffffffffa0176022 ffff880037422000 ffff88007b081d60
    ffffffffa015c07b ffff880037600600 ffff88007b081dc8 ffffffffa01610e1
    Call Trace:
    [] ? __cancel_work_timer+0x75/0xf0
    [] cifs_crypto_shash_release+0x82/0xf0 [cifs]
    [] cifs_put_tcp_session+0x8b/0xe0 [cifs]
    [] cifs_mount+0x9d1/0xad0 [cifs]
    [] cifs_do_mount+0xa0/0x4d0 [cifs]
    [] mount_fs+0x39/0x1b0
    [] vfs_kern_mount+0x5f/0xf0
    [] do_mount+0x23e/0xa20
    [] ? copy_mount_options+0x36/0x170
    [] SyS_mount+0x83/0xc0
    [] system_call_fastpath+0x16/0x1b
    Code: eb 9e 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 55 48 89 e5 41 55 41 54 49 89 fc 53 48 83 ec 08 48 85 ff 74 46 83 7e 48 00 48 8b 5e 50 74 4b 48 89 f7 e8 83 fc ff ff 4c 8b
    RIP [] crypto_destroy_tfm+0x1a/0x90
    RSP
    CR2: 000000000000004e

    The cifs code allocates some crypto structures. If that fails, it
    returns an error, but it leaves the pointers set to their PTR_ERR
    values. Then later when it tries to clean up, it sees that those values
    are non-NULL and then passes them to the routine that frees them.

    Fix this by setting the pointers to NULL after collecting the error code
    in this situation.

    Cc: Sachin Prabhu
    Reported-by: Jarod Wilson
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

31 Jul, 2013

1 commit

  • For cifs_set_cifscreds() in "fs/cifs/connect.c", 'desc' buffer length
    is 'CIFSCREDS_DESC_SIZE' (56 is less than 256), and 'ses->domainName'
    length may be "255 + '\0'".

    The related sprintf() may cause memory overflow, so need extend related
    buffer enough to hold all things.

    It is also necessary to be sure of 'ses->domainName' must be less than
    256, and define the related macro instead of hard code number '256'.

    Signed-off-by: Chen Gang
    Reviewed-by: Jeff Layton
    Reviewed-by: Shirish Pargaonkar
    Reviewed-by: Scott Lovenberg
    CC:
    Signed-off-by: Steve French

    Chen Gang
     

05 Jul, 2013

1 commit

  • Updated patch to try to prevent allocation of cifs, smb2 or smb3 crypto
    secmech structures unless needed. Currently cifs allocates all crypto
    mechanisms when the first session is established (4 functions and
    4 contexts), rather than only allocating these when needed (smb3 needs
    two, the rest of the dialects only need one).

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

    Steve French
     

27 Jun, 2013

2 commits

  • 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
     
  • This is RH bug 970891
    Uppercasing of username during calculation of ntlmv2 hash fails
    because UniStrupr function does not handle big endian wchars.

    Also fix a comment in the same code to reflect its correct usage.

    [To make it easier for stable (rather than require 2nd patch) fixed
    this patch of Shirish's to remove endian warning generated
    by sparse -- steve f.]

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

    Steve French
     

24 Jun, 2013

2 commits

  • Now that we track what sort of NEGOTIATE response was received, stop
    mandating that every session on a socket use the same type of auth.

    Push that decision out into the session setup code, and make the sectype
    a per-session property. This should allow us to mix multiple sectypes on
    a socket as long as they are compatible with the NEGOTIATE response.

    With this too, we can now eliminate the ses->secFlg field since that
    info is redundant and harder to work with than a securityEnum.

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

    Jeff Layton
     
  • It turns out that CIFS_SESS_KEY_SIZE == CIFS_ENCPWD_SIZE, so this
    memset doesn't do anything useful.

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

    Jeff Layton
     

05 May, 2013

2 commits

  • Currently, the signing routines take a pointer to a place to store the
    expected sequence number for the mid response. It then stores a value
    that's one below what that sequence number should be, and then adds one
    to it when verifying the signature on the response.

    Increment the sequence number before storing the value in the mid, and
    eliminate the "+1" when checking the signature.

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

    Jeff Layton
     
  • It's not obvious from reading the macro names that these macros
    are for debugging. Convert the names to a single more typical
    kernel style cifs_dbg macro.

    cERROR(1, ...) -> cifs_dbg(VFS, ...)
    cFYI(1, ...) -> cifs_dbg(FYI, ...)
    cFYI(DBG2, ...) -> cifs_dbg(NOISY, ...)

    Move the terminating format newline from the macro to the call site.

    Add CONFIG_CIFS_DEBUG function cifs_vfs_err to emit the
    "CIFS VFS: " prefix for VFS messages.

    Size is reduced ~ 1% when CONFIG_CIFS_DEBUG is set (default y)

    $ size fs/cifs/cifs.ko*
    text data bss dec hex filename
    265245 2525 132 267902 4167e fs/cifs/cifs.ko.new
    268359 2525 132 271016 422a8 fs/cifs/cifs.ko.old

    Other miscellaneous changes around these conversions:

    o Miscellaneous typo fixes
    o Add terminating \n's to almost all formats and remove them
    from the macros to be more kernel style like. A few formats
    previously had defective \n's
    o Remove unnecessary OOM messages as kmalloc() calls dump_stack
    o Coalesce formats to make grep easier,
    added missing spaces when coalescing formats
    o Use %s, __func__ instead of embedded function name
    o Removed unnecessary "cifs: " prefixes
    o Convert kzalloc with multiply to kcalloc
    o Remove unused cifswarn macro

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

    Joe Perches
     

25 Sep, 2012

3 commits

  • Use the smb_send_rqst helper function to kmap each page in the array
    and update the hash for that chunk.

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

    Jeff Layton
     
  • We need a way to represent a call to be sent on the wire that does not
    require having all of the page data kmapped. Behold the smb_rqst struct.
    This new struct represents an array of kvecs immediately followed by an
    array of pages.

    Convert the signing routines to use these structs under the hood and
    turn the existing functions for this into wrappers around that. For now,
    we're just changing these functions to take different args. Later, we'll
    teach them how to deal with arrays of pages.

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

    Jeff Layton
     
  • 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