1. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  2. 06 2月, 2010 1 次提交
    • S
      [CIFS] Maximum username length check in session setup does not match · 301a6a31
      Steve French 提交于
      Fix length check reported by D. Binderman (see below)
      
      d binderman <dcb314@hotmail.com> 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: NSteve French <sfrench@us.ibm.com>
      301a6a31
  3. 25 6月, 2009 1 次提交
  4. 06 5月, 2009 1 次提交
  5. 04 5月, 2009 1 次提交
    • S
      [CIFS] NTLMSSP reenabled after move from connect.c to sess.c · 0b3cc858
      Steve French 提交于
      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: NSteve French <sfrench@us.ibm.com>
      0b3cc858
  6. 02 5月, 2009 1 次提交
  7. 01 5月, 2009 1 次提交
    • S
      [CIFS] rename cifs_strndup to cifs_strndup_from_ucs · d185cda7
      Steve French 提交于
      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: NSteve French <sfrench@us.ibm.com>
      d185cda7
  8. 30 4月, 2009 1 次提交
  9. 17 4月, 2009 2 次提交
    • J
      cifs: add cFYI messages with some of the saved strings from ssetup/tcon · 313fecfa
      Jeff Layton 提交于
      ...to make it easier to find problems in this area in the future.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      313fecfa
    • J
      cifs: fix unicode string area word alignment in session setup · 27b87fe5
      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: NJeff Layton <jlayton@redhat.com>
      CC: Stable <stable@vger.kernel.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      27b87fe5
  10. 21 2月, 2009 2 次提交
    • S
      [CIFS] Fix multiuser mounts so server does not invalidate earlier security contexts · eca6acf9
      Steve French 提交于
      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: NSteve French <sfrench@us.ibm.com>
      eca6acf9
    • S
      [CIFS] Fix oops in cifs_strfromUCS_le mounting to servers which do not specify their OS · 69765529
      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: NJeff Layton <jlayton@redhat.com>
      CC: stable <stable@kernel.org>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      69765529
  11. 26 12月, 2008 1 次提交
  12. 25 9月, 2008 1 次提交
    • J
      cifs: explicitly revoke SPNEGO key after session setup · dfd15c46
      Jeff Layton 提交于
      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: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      dfd15c46
  13. 28 8月, 2008 1 次提交
  14. 26 8月, 2008 1 次提交
  15. 20 8月, 2008 1 次提交
  16. 13 2月, 2008 1 次提交
  17. 31 12月, 2007 2 次提交
  18. 17 11月, 2007 1 次提交
  19. 14 11月, 2007 1 次提交
    • S
      [CIFS] Fix buffer overflow if server sends corrupt response to small · 133672ef
      Steve French 提交于
      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 <shaggy@austin.ibm.com>
      CC: Przemyslaw Wegrzyn <czajnik@czajsoft.pl>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      133672ef
  20. 19 10月, 2007 1 次提交
  21. 17 10月, 2007 1 次提交
  22. 31 8月, 2007 1 次提交
  23. 18 8月, 2007 1 次提交
  24. 18 7月, 2007 1 次提交
  25. 13 7月, 2007 1 次提交
  26. 09 7月, 2007 1 次提交
  27. 08 7月, 2007 2 次提交
  28. 22 1月, 2007 1 次提交
  29. 09 11月, 2006 1 次提交
    • S
      [CIFS] Fix mount failure when domain not specified · 6e659c63
      Steve French 提交于
          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: NSteve French <sfrench@us.ibm.com>
      6e659c63
  30. 02 10月, 2006 1 次提交
    • S
      [PATCH] namespaces: utsname: use init_utsname when appropriate · 96b644bd
      Serge E. Hallyn 提交于
      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: NSerge E. Hallyn <serue@us.ibm.com>
      Cc: Kirill Korotaev <dev@openvz.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Herbert Poetzl <herbert@13thfloor.at>
      Cc: Andrey Savochkin <saw@sw.ru>
      Cc: Serge Hallyn <serue@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      96b644bd
  31. 30 9月, 2006 1 次提交
    • S
      [CIFS] Do not send newer QFSInfo to legacy servers which can not support it · 9ac00b7d
      Steve French 提交于
      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: NSteve French <sfrench@us.ibm.com>
      9ac00b7d
  32. 15 8月, 2006 1 次提交
  33. 28 6月, 2006 2 次提交
  34. 27 6月, 2006 1 次提交
  35. 23 6月, 2006 1 次提交