09 Jan, 2012

1 commit

  • * 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (165 commits)
    reiserfs: Properly display mount options in /proc/mounts
    vfs: prevent remount read-only if pending removes
    vfs: count unlinked inodes
    vfs: protect remounting superblock read-only
    vfs: keep list of mounts for each superblock
    vfs: switch ->show_options() to struct dentry *
    vfs: switch ->show_path() to struct dentry *
    vfs: switch ->show_devname() to struct dentry *
    vfs: switch ->show_stats to struct dentry *
    switch security_path_chmod() to struct path *
    vfs: prefer ->dentry->d_sb to ->mnt->mnt_sb
    vfs: trim includes a bit
    switch mnt_namespace ->root to struct mount
    vfs: take /proc/*/mounts and friends to fs/proc_namespace.c
    vfs: opencode mntget() mnt_set_mountpoint()
    vfs: spread struct mount - remaining argument of next_mnt()
    vfs: move fsnotify junk to struct mount
    vfs: move mnt_devname
    vfs: move mnt_list to struct mount
    vfs: switch pnode.h macros to struct mount *
    ...

    Linus Torvalds
     

04 Jan, 2012

3 commits

  • Turned out the ntlmv2 (default security authentication)
    upgrade was harder to test than expected, and we ran
    out of time to test against Apple and a few other servers
    that we wanted to. Delay upgrade of default security
    from ntlm to ntlmv2 (on mount) to 3.3. Still works
    fine to specify it explicitly via "sec=ntlmv2" so this
    should be fine.

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

    Steve French
     
  • Signed-off-by: Al Viro

    Al Viro
     
  • The current check looks to see if the RFC1002 length is larger than
    CIFSMaxBufSize, and fails if it is. The buffer is actually larger than
    that by MAX_CIFS_HDR_SIZE.

    This bug has been around for a long time, but the fact that we used to
    cap the clients MaxBufferSize at the same level as the server tended
    to paper over it. Commit c974befa changed that however and caused this
    bug to bite in more cases.

    Reported-and-Tested-by: Konstantinos Skarlatos
    Tested-by: Shirish Pargaonkar
    Signed-off-by: Jeff Layton
    Signed-off-by: Steve French

    Jeff Layton
     

09 Dec, 2011

1 commit


07 Nov, 2011

1 commit

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     

01 Nov, 2011

1 commit

  • Some files were using the complete module.h infrastructure without
    actually including the header at all. Fix them up in advance so
    once the implicit presence is removed, we won't get failures like this:

    CC [M] fs/nfsd/nfssvc.o
    fs/nfsd/nfssvc.c: In function 'nfsd_create_serv':
    fs/nfsd/nfssvc.c:335: error: 'THIS_MODULE' undeclared (first use in this function)
    fs/nfsd/nfssvc.c:335: error: (Each undeclared identifier is reported only once
    fs/nfsd/nfssvc.c:335: error: for each function it appears in.)
    fs/nfsd/nfssvc.c: In function 'nfsd':
    fs/nfsd/nfssvc.c:555: error: implicit declaration of function 'module_put_and_exit'
    make[3]: *** [fs/nfsd/nfssvc.o] Error 1

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

30 Oct, 2011

1 commit

  • Re-posting a patch originally posted by Oskar Liljeblad after
    rebasing on 3.2.

    Modify cifs to assume that the supplied password is encoded according
    to iocharset. Before this patch passwords would be treated as
    raw 8-bit data, which made authentication with Unicode passwords impossible
    (at least passwords with characters > 0xFF).

    The previous code would as a side effect accept passwords encoded with
    ISO 8859-1, since Unicode < 0x100 basically is ISO 8859-1. Software which
    relies on that will no longer support password chars > 0x7F unless it also
    uses iocharset=iso8859-1. (mount.cifs does not care about the encoding so
    it will work as expected.)

    Signed-off-by: Oskar Liljeblad
    Signed-off-by: Shirish Pargaonkar
    Reviewed-by: Pavel Shilovsky
    Tested-by: A
    Signed-off-by: Steve French

    Shirish Pargaonkar
     

29 Oct, 2011

1 commit

  • * '3.2-without-smb2' of git://git.samba.org/sfrench/cifs-2.6: (52 commits)
    Fix build break when freezer not configured
    Add definition for share encryption
    CIFS: Make cifs_push_locks send as many locks at once as possible
    CIFS: Send as many mandatory unlock ranges at once as possible
    CIFS: Implement caching mechanism for posix brlocks
    CIFS: Implement caching mechanism for mandatory brlocks
    CIFS: Fix DFS handling in cifs_get_file_info
    CIFS: Fix error handling in cifs_readv_complete
    [CIFS] Fixup trivial checkpatch warning
    [CIFS] Show nostrictsync and noperm mount options in /proc/mounts
    cifs, freezer: add wait_event_freezekillable and have cifs use it
    cifs: allow cifs_max_pending to be readable under /sys/module/cifs/parameters
    cifs: tune bdi.ra_pages in accordance with the rsize
    cifs: allow for larger rsize= options and change defaults
    cifs: convert cifs_readpages to use async reads
    cifs: add cifs_async_readv
    cifs: fix protocol definition for READ_RSP
    cifs: add a callback function to receive the rest of the frame
    cifs: break out 3rd receive phase into separate function
    cifs: find mid earlier in receive codepath
    ...

    Linus Torvalds
     

25 Oct, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (59 commits)
    MAINTAINERS: linux-m32r is moderated for non-subscribers
    linux@lists.openrisc.net is moderated for non-subscribers
    Drop default from "DM365 codec select" choice
    parisc: Kconfig: cleanup Kernel page size default
    Kconfig: remove redundant CONFIG_ prefix on two symbols
    cris: remove arch/cris/arch-v32/lib/nand_init.S
    microblaze: add missing CONFIG_ prefixes
    h8300: drop puzzling Kconfig dependencies
    MAINTAINERS: microblaze-uclinux@itee.uq.edu.au is moderated for non-subscribers
    tty: drop superfluous dependency in Kconfig
    ARM: mxc: fix Kconfig typo 'i.MX51'
    Fix file references in Kconfig files
    aic7xxx: fix Kconfig references to READMEs
    Fix file references in drivers/ide/
    thinkpad_acpi: Fix printk typo 'bluestooth'
    bcmring: drop commented out line in Kconfig
    btmrvl_sdio: fix typo 'btmrvl_sdio_sd6888'
    doc: raw1394: Trivial typo fix
    CIFS: Don't free volume_info->UNC until we are entirely done with it.
    treewide: Correct spelling of successfully in comments
    ...

    Linus Torvalds
     

20 Oct, 2011

12 commits

  • Tune bdi.ra_pages to be a multiple of the rsize. This prevents the VFS
    from asking for pages that require small reads to satisfy.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Currently we cap the rsize at a value that fits in CIFSMaxBufSize. That's
    not needed any longer for readpages. Allow the use of larger values for
    readpages. cifs_iovec_read and cifs_read however are still limited to the
    CIFSMaxBufSize. Make sure they don't exceed that.

    The patch also changes the rsize defaults. The default when unix
    extensions are enabled is set to 1M for parity with the wsize, and there
    is a hard cap of ~16M.

    When unix extensions are not enabled, the default is set to 60k. According
    to MS-CIFS, Windows servers can only send a max of 60k at a time, so
    this is more efficient than requesting a larger size. If the user wishes
    however, the max can be extended up to 128k - the length of the READ_RSP
    header.

    Really old servers however require a special hack to ensure that we don't
    request too large a read.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • ...which will allow cifs to do an asynchronous read call to the server.
    The caller will allocate and set up cifs_readdata for each READ_AND_X
    call that should be issued on the wire. The pages passed in are added
    to the pagecache, but not placed on the LRU list yet (as we need the
    page->lru to keep the pages on the list in the readdata).

    When cifsd identifies the mid, it will see that there is a special
    receive handler for the call, and use that to receive the rest of the
    frame. cifs_readv_receive will then marshal up a kvec array with
    kmapped pages from the pagecache, which eliminates one copy of the
    data. Once the data is received, the pages are added to the LRU list,
    set uptodate, and unlocked.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • In order to handle larger SMBs for readpages and other calls, we want
    to be able to read into a preallocated set of buffers. Rather than
    changing all of the existing code to preallocate buffers however, we
    instead add a receive callback function to the MID.

    cifsd will call this function once the mid_q_entry has been identified
    in order to receive the rest of the SMB. If the mid can't be identified
    or the receive pointer is unset, then the standard 3rd phase receive
    function will be called.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Move the entire 3rd phase of the receive codepath into a separate
    function in preparation for the addition of a pluggable receive
    function.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • In order to receive directly into a preallocated buffer, we need to ID
    the mid earlier, before the bulk of the response is read. Call the mid
    finding routine as soon as we're able to read the mid.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • We have several functions that need to access these pointers. Currently
    that's done with a lot of double pointer passing. Instead, move them
    into the TCP_Server_Info and simplify the handling.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Change find_cifs_mid to only return NULL if a mid could not be found.
    If we got part of a multi-part T2 response, then coalesce it and still
    return the mid. The caller can determine the T2 receive status from
    the flags in the mid.

    With this change, there is no need to pass a pointer to "length" as
    well so just pass by value. If a mid is found, then we can just mark
    it as malformed. If one isn't found, then the value of "length" won't
    change anyway.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Begin breaking up find_cifs_mid into smaller pieces. The parts that
    coalesce T2 responses don't really need to be done under the
    GlobalMid_lock anyway. Create a new function that just finds the
    mid on the list, and then later takes it off the list if the entire
    response has been received.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Have the demultiplex thread receive just enough to get to the MID, and
    then find it before receiving the rest. Later, we'll use this to swap
    in a preallocated receive buffer for some calls.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Having to continually allocate a new kvec array is expensive. Allocate
    one that's big enough, and only reallocate it as needed.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     
  • Eventually we'll want to allow cifsd to read data directly into the
    pagecache. In order to do that we'll need a routine that can take a
    kvec array and pass that directly to kernel_recvmsg.

    Unfortunately though, the kernel's recvmsg routines modify the kvec
    array that gets passed in, so we need to use a copy of the kvec array
    and refresh that copy on each pass through the loop.

    Reviewed-and-Tested-by: Pavel Shilovsky
    Signed-off-by: Jeff Layton

    Jeff Layton
     

14 Oct, 2011

2 commits

  • Rename it for better clarity as to what it does and have the caller pass
    in just the single type byte. Turn the if statement into a switch and
    optimize it by placing the most common message type at the top. Move the
    header length check back into cifs_demultiplex_thread in preparation
    for adding a new receive phase and normalize the cFYI messages.

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

    Jeff Layton
     
  • ..the length field has only 17 bits.

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

    Pavel Shilovsky
     

13 Oct, 2011

6 commits

  • Move the iovec handling entirely into read_from_socket. That simplifies
    the code and gets rid of the special handling for header reads. With
    this we can also get rid of the "goto incomplete_rcv" label in the main
    demultiplex thread function since we can now treat header and non-header
    receives the same way.

    Also, make it return an int (since we'll never receive enough to worry
    about the sign bit anyway), and simply make it return the amount of bytes
    read or a negative error code.

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

    Jeff Layton
     
  • Add mount options backupuid and backugid.

    It allows an authenticated user to access files with the intent to back them
    up including their ACLs, who may not have access permission but has
    "Backup files and directories user right" on them (by virtue of being part
    of the built-in group Backup Operators.

    When mount options backupuid is specified, cifs client restricts the
    use of backup intents to the user whose effective user id is specified
    along with the mount option.

    When mount options backupgid is specified, cifs client restricts the
    use of backup intents to the users whose effective user id belongs to the
    group id specified along with the mount option.

    If an authenticated user is not part of the built-in group Backup Operators
    at the server, access to such files is denied, even if allowed by the client.

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

    Shirish Pargaonkar
     
  • If the server stops sending data while in the middle of sending a
    response then we still want to reconnect it if it doesn't come back.

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

    Jeff Layton
     
  • If msg_controllen is 0, then the socket layer should never touch these
    fields. Thus, there's no need to continually reset them. Also, there's
    no need to keep this field on the stack for the demultiplex thread, just
    make it a local variable in read_from_socket.

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

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

    Jeff Layton
     
  • server->maxBuf is the maximum SMB size (including header) that the
    server can handle. CIFSMaxBufSize is the maximum amount of data (sans
    header) that the client can handle. Currently maxBuf is being capped at
    CIFSMaxBufSize + the max headers size, and the two values are used
    somewhat interchangeably in the code.

    This makes little sense as these two values are not related at all.
    Separate them and make sure the code uses the right values in the right
    places.

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

    Jeff Layton
     

08 Oct, 2011

1 commit


28 Sep, 2011

1 commit

  • In cleanup_volume_info_contents() we kfree(volume_info->UNC); and then
    proceed to use that variable on the very next line.
    This causes (at least) Coverity Prevent to complain about use-after-free
    of that variable (and I guess other checkers may do that as well).
    There's not any /real/ problem here since we are just using the value of
    the pointer, not actually dereferencing it, but it's still trivial to
    silence the tool, so why not?
    To me at least it also just seems nicer to defer freeing the variable
    until we are entirely done with it in all respects.

    Signed-off-by: Jesper Juhl
    Reviewed-by: Jeff Layton
    Signed-off-by: Jiri Kosina

    Jesper Juhl
     

20 Sep, 2011

1 commit


19 Aug, 2011

1 commit

  • CIFS cleanup_volume_info_contents() looks like having a memory
    corruption problem.
    When UNCip is set to "&vol->UNC[2]" in cifs_parse_mount_options(), it
    should not be kfree()-ed in cleanup_volume_info_contents().

    Introduced in commit b946845a9dc523c759cae2b6a0f6827486c3221a

    Signed-off-by: J.R. Okajima
    Reviewed-by: Jeff Layton
    CC: Stable
    Signed-off-by: Steve French

    Steve French
     

01 Aug, 2011

6 commits