06 Feb, 2010

1 commit

  • Fix length check reported by D. Binderman (see below)

    d binderman wrote:
    >
    > I just ran the sourceforge tool cppcheck over the source code of the
    > new Linux kernel 2.6.33-rc6
    >
    > It said
    >
    > [./cifs/sess.c:250]: (error) Buffer access out-of-bounds

    May turn out to be harmless, but best to be safe. Note max
    username length is defined to 32 due to Linux (Windows
    maximum is 20).

    Signed-off-by: Steve French

    Steve French
     

25 Jun, 2009

1 commit

  • Also removes obsolete distinction between rawntlmssp and ntlmssp (in asn/SPNEGO)
    since as jra noted we can always send raw ntlmssp in session setup now.

    remove check for experimental runtime flag (/proc/fs/cifs/Experimental) in
    ntlmssp path.

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

    Steve French
     

06 May, 2009

1 commit


04 May, 2009

1 commit

  • The NTLMSSP code was removed from fs/cifs/connect.c and merged
    (75% smaller, cleaner) into fs/cifs/sess.c

    As with the old code it requires that cifs be built with
    CONFIG_CIFS_EXPERIMENTAL, the /proc/fs/cifs/Experimental flag
    must be set to 2, and mount must turn on extended security
    (e.g. with sec=krb5).

    Although NTLMSSP encapsulated in SPNEGO is not enabled yet,
    "raw" ntlmssp is common and useful in some cases since it
    offers more complete security negotiation, and is the
    default way of negotiating security for many Windows systems.
    SPNEGO encapsulated NTLMSSP will be able to reuse the same
    code.

    Signed-off-by: Steve French

    Steve French
     

02 May, 2009

1 commit

  • When multiply mounting from the same client to the same server, with
    different userids, we create a vcnum which should be unique if
    possible (this is not the same as the smb uid, which is the handle
    to the security context). We were not endian converting additional
    (beyond the first which is zero) vcnum properly.

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

    Steve French
     

01 May, 2009

1 commit

  • In most cases, cifs_strndup is converting from Unicode (UCS2 / UTF-32) to
    the configured local code page for the Linux mount (usually UTF8), so
    Jeff suggested that to make it more clear that cifs_strndup is doing
    a conversion not just memory allocation and copy, rename the function
    to including "from_ucs" (ie Unicode)

    Signed-off-by: Steve French

    Steve French
     

30 Apr, 2009

1 commit


17 Apr, 2009

2 commits

  • ...to make it easier to find problems in this area in the future.

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

    Jeff Layton
     
  • The handling of unicode string area alignment is wrong.
    decode_unicode_ssetup improperly assumes that it will always be preceded
    by a pad byte. This isn't the case if the string area is already
    word-aligned.

    This problem, combined with the bad buffer sizing for the serverDomain
    string can cause memory corruption. The bad alignment can make it so
    that the alignment of the characters is off. This can make them
    translate to characters that are greater than 2 bytes each. If this
    happens we can overflow the allocation.

    Fix this by fixing the alignment in CIFS_SessSetup instead so we can
    verify it against the head of the response. Also, clean up the
    workaround for improperly terminated strings by checking for a
    odd-length unicode buffers and then forcibly terminating them.

    Finally, resize the buffer for serverDomain. Now that we've fixed
    the alignment, it's probably fine, but a malicious server could
    overflow it.

    A better solution for handling these strings is still needed, but
    this should be a suitable bandaid.

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

    Jeff Layton
     

21 Feb, 2009

2 commits

  • When two different users mount the same Windows 2003 Server share using CIFS,
    the first session mounted can be invalidated. Some servers invalidate the first
    smb session when a second similar user (e.g. two users who get mapped by server to "guest")
    authenticates an smb session from the same client.

    By making sure that we set the 2nd and subsequent vc numbers to nonzero values,
    this ensures that we will not have this problem.

    Fixes Samba bug 6004, problem description follows:
    How to reproduce:

    - configure an "open share" (full permissions to Guest user) on Windows 2003
    Server (I couldn't reproduce the problem with Samba server or Windows older
    than 2003)
    - mount the share twice with different users who will be authenticated as guest.

    noacl,noperm,user=john,dir_mode=0700,domain=DOMAIN,rw
    noacl,noperm,user=jeff,dir_mode=0700,domain=DOMAIN,rw

    Result:

    - just the mount point mounted last is accessible:

    Signed-off-by: Steve French

    Steve French
     
  • Fixes kernel bug #10451 http://bugzilla.kernel.org/show_bug.cgi?id=10451

    Certain NAS appliances do not set the operating system or network operating system
    fields in the session setup response on the wire. cifs was oopsing on the unexpected
    zero length response fields (when trying to null terminate a zero length field).

    This fixes the oops.

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

    Steve French
     

26 Dec, 2008

1 commit

  • cifs: have calc_lanman_hash take more granular args

    We need to use this routine to encrypt passwords associated with the
    tcon too. Don't assume that the password will be attached to the
    smb_session.

    Also, make some of the values in the lower encryption functions
    const since they aren't changed.

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

    Jeff Layton
     

25 Sep, 2008

1 commit

  • cifs: explicitly revoke SPNEGO key after session setup

    The SPNEGO blob returned by an upcall can only be used once. Explicitly
    revoke it to make sure that we never pick it up again after session
    setup exits.

    This doesn't seem to be that big an issue on more recent kernels, but
    older kernels seem to link keys into the session keyring by default.
    That said, explicitly revoking the key seems like a reasonable thing
    to do here.

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

    Jeff Layton
     

28 Aug, 2008

1 commit


26 Aug, 2008

1 commit


20 Aug, 2008

1 commit

  • Properly handle MSKRB5 by passing sec=mskrb5 to the upcall so that the
    spengo blob can be generated appropriately. Also, make
    decode_negTokenInit prefer whichever mechanism is first in the list.

    Needed for some NetApp servers, and possibly some older
    versions of Windows which treat the two KRB5 mechanisms differently.

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

    Steve French
     

13 Feb, 2008

1 commit


31 Dec, 2007

2 commits


17 Nov, 2007

1 commit

  • Have CIFS_SessSetup call cifs_get_spnego_key when Kerberos is
    negotiated. Use the info in the key payload to build a session
    setup request packet. Also clean up how the request buffer in
    the function is freed on error.

    With appropriate user space helper (in samba/source/client). Kerberos
    support (secure session establishment can be done now via Kerberos,
    previously users would have to use NTLMv2 instead for more secure
    session setup).

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

    Steve French
     

14 Nov, 2007

1 commit

  • request

    In SendReceive() function in transport.c - it memcpy's
    message payload into a buffer passed via out_buf param. The function
    assumes that all buffers are of size (CIFSMaxBufSize +
    MAX_CIFS_HDR_SIZE) , unfortunately it is also called with smaller
    (MAX_CIFS_SMALL_BUFFER_SIZE) buffers. There are eight callers
    (SMB worker functions) which are primarily affected by this change:

    TreeDisconnect, uLogoff, Close, findClose, SetFileSize, SetFileTimes,
    Lock and PosixLock

    CC: Dave Kleikamp
    CC: Przemyslaw Wegrzyn
    Acked-by: Jeff Layton
    Signed-off-by: Steve French

    Steve French
     

19 Oct, 2007

1 commit


17 Oct, 2007

1 commit


31 Aug, 2007

1 commit


18 Aug, 2007

1 commit


18 Jul, 2007

1 commit


13 Jul, 2007

1 commit

  • This should be the last big batch of whitespace/formatting fixes.
    checkpatch warnings for the cifs directory are down about 90% and
    many of the remaining ones are harder to remove or make the code
    harder to read.

    Signed-off-by: Steve French

    Steve French
     

09 Jul, 2007

1 commit


08 Jul, 2007

2 commits


22 Jan, 2007

1 commit

  • Fixes RedHat bug 211672

    Windows sends one byte (instead of two) of null to terminate final Unicode
    string (domain name) in session setup response in some cases - this caused
    cifs to misalign some informational strings (making it hard to convert
    from UCS16 to UTF8).

    Thanks to Shaggy for his help and Akemi Yagi for debugging/testing

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

    Steve French
     

09 Nov, 2006

1 commit

  • Fixes Samba bugzilla #4176

    When users do not specify their domain on mount, 2.6.18 started sending
    default domain instead of a null domain (which was the only way on some
    servers to use a default domain). Users of 2.6.18 who did not specify
    their domain name on mounts to certain common Windows servers that were
    members of a domain, but not the domain controller, would get mount
    failures which they did not get in 2.6.18

    This fixes that issue and should remove complaints about mount
    behavior changing.

    Signed-off-by: Steve French

    Steve French
     

13 Oct, 2006

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: (27 commits)
    [CIFS] Missing flags2 for DFS
    [CIFS] Workaround incomplete byte length returned by some
    [CIFS] cifs Kconfig: don't select CONNECTOR
    [CIFS] Level 1 QPathInfo needed for proper OS2 support
    [CIFS] fix typo in previous patch
    [CIFS] Fix old DOS time conversion to handle timezone
    [CIFS] Do not need to adjust for Jan/Feb for leap day
    [CIFS] Fix leaps year calculation for years after 2100
    [CIFS] readdir (ffirst) enablement of accurate timestamps from legacy servers
    [CIFS] Fix compiler warning with previous patch
    [CIFS] Fix typo
    [CIFS] Allow for 15 minute TZs (e.g. Nepal) and be more explicit about
    [CIFS] Fix readdir of large directories for backlevel servers
    [CIFS] Allow LANMAN21 support even in both POSIX non-POSIX path
    [CIFS] Make use of newer QFSInfo dependent on capability bit instead of
    [CIFS] Do not send newer QFSInfo to legacy servers which can not support it
    [CIFS] Fix typo in name of new cifs_show_stats
    [CIFS] Rename server time zone field
    [CIFS] Handle legacy servers which return undefined time zone
    [CIFS] CIFS support for /proc//mountstats part 1
    ...

    Manual conflict resolution in fs/cifs/connect.c

    Linus Torvalds
     

02 Oct, 2006

1 commit

  • In some places, particularly drivers and __init code, the init utsns is the
    appropriate one to use. This patch replaces those with a the init_utsname
    helper.

    Changes: Removed several uses of init_utsname(). Hope I picked all the
    right ones in net/ipv4/ipconfig.c. These are now changed to
    utsname() (the per-process namespace utsname) in the previous
    patch (2/7)

    [akpm@osdl.org: CIFS fix]
    Signed-off-by: Serge E. Hallyn
    Cc: Kirill Korotaev
    Cc: "Eric W. Biederman"
    Cc: Herbert Poetzl
    Cc: Andrey Savochkin
    Cc: Serge Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn
     

30 Sep, 2006

1 commit

  • Fix dialect negotiation to save off when we have negotiated lanman.
    This allows us to avoid sending some somewhat newer requests that the server
    can not handle and go directly to the older version (infolevel) of the same
    call. Make sure we try to negotiate a level which allows us to get the
    server OS (which we check so we can detect Win9x vs. other legacy servers
    and eventually work around the Win9x DOS time bug (they reverse date/time
    fields).

    Signed-off-by: Steve French

    Steve French
     

15 Aug, 2006

1 commit


28 Jun, 2006

2 commits


27 Jun, 2006

1 commit


23 Jun, 2006

1 commit