1. 06 8月, 2010 6 次提交
    • W
      DNS: Separate out CIFS DNS Resolver code · 1a4240f4
      Wang Lei 提交于
      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 "[<type>:]<domain_name>".  The optional <type>
      indicates the particular DNS lookup and packaging that's required.  The
      <domain_name> is the query to be made.
      
      If <type> 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: NWang Lei <wang840925@gmail.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      1a4240f4
    • J
      cifs: account for new creduid=0x%x parameter in spnego upcall string · ba5dadbf
      Jeff Layton 提交于
      The commit that added the creduid=0x%x parameter failed to increase the
      buffer allocation to account for it.
      Reported-by: NJ. Bruce Fields <bfields@fieldses.org>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      ba5dadbf
    • J
      cifs: reduce false positives with inode aliasing serverino autodisable · 5acfec25
      Jeff Layton 提交于
      It turns out that not all directory inodes with dentries on the
      i_dentry list are unusable here. We only consider them unusable if they
      are still hashed or if they have a root dentry attached.
      
      Full disclosure -- this check is inherently racy. There's nothing that
      stops someone from slapping a new dentry onto this inode just after
      this check, or hashing an existing one that's already attached. So,
      this is really a "best effort" thing to work around misbehaving servers.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      5acfec25
    • D
      CIFS: Make cifs_convert_address() take a const src pointer and a length · 67b7626a
      David Howells 提交于
      Make cifs_convert_address() take a const src pointer and a length so that all
      the strlen() calls in their can be cut out and to make it unnecessary to modify
      the src string.
      
      Also return the data length from dns_resolve_server_name_to_ip() so that a
      strlen() can be cut out of cifs_compose_mount_options() too.
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      67b7626a
    • S
      cifs: show features compiled in as part of DebugData · f579903e
      Suresh Jayaraman 提交于
      Fixed the nit pointed out by Jeff.
      
      From: Suresh Jayaraman <sjayaraman@suse.de>
      Subject: [PATCH 1/2] cifs: show features compiled in as part of DebugData
      
      This patch adds the features that are compiled in to the CIFS debugging data
      as shown below:
      
      	$cat /proc/fs/cifs/DebugData
      	Display Internal CIFS Data Structures for Debugging
      	---------------------------------------------------
      	CIFS Version 1.64
      	Features: dfs fscache posix spnego xattr
      	Active VFS Requests: 0
      	...
      
      This patch provides a definitive way to tell what features are currently
      enabled in the running kernel. This could also help debugging.
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Cc: Jeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      f579903e
    • S
      cifs: update README · 95c99904
      Suresh Jayaraman 提交于
      Update the README file to reflect that now DebugData shows all
      the features enabled.
      Signed-off-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Cc: Jeff Layton <jlayton@redhat.com>
      --
       fs/cifs/README |    5 +++--
       1 files changed, 3 insertions(+), 2 deletions(-)
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      95c99904
  2. 02 8月, 2010 29 次提交
  3. 31 7月, 2010 1 次提交
  4. 23 7月, 2010 2 次提交
    • T
      cifs: use workqueue instead of slow-work · 9b646972
      Tejun Heo 提交于
      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: NTejun Heo <tj@kernel.org>
      Acked-by: NSteve French <sfrench@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      9b646972
    • D
      CIFS: Fix a malicious redirect problem in the DNS lookup code · 4c0c03ca
      David Howells 提交于
      Fix the security problem in the CIFS filesystem DNS lookup code in which a
      malicious redirect could be installed by a random user by simply adding a
      result record into one of their keyrings with add_key() and then invoking a
      CIFS CFS lookup [CVE-2010-2524].
      
      This is done by creating an internal keyring specifically for the caching of
      DNS lookups.  To enforce the use of this keyring, the module init routine
      creates a set of override credentials with the keyring installed as the thread
      keyring and instructs request_key() to only install lookup result keys in that
      keyring.
      
      The override is then applied around the call to request_key().
      
      This has some additional benefits when a kernel service uses this module to
      request a key:
      
       (1) The result keys are owned by root, not the user that caused the lookup.
      
       (2) The result keys don't pop up in the user's keyrings.
      
       (3) The result keys don't come out of the quota of the user that caused the
           lookup.
      
      The keyring can be viewed as root by doing cat /proc/keys:
      
      2a0ca6c3 I-----     1 perm 1f030000     0     0 keyring   .dns_resolver: 1/4
      
      It can then be listed with 'keyctl list' by root.
      
      	# keyctl list 0x2a0ca6c3
      	1 key in keyring:
      	726766307: --alswrv     0     0 dns_resolver: foo.bar.com
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-and-Tested-by: NJeff Layton <jlayton@redhat.com>
      Acked-by: NSteve French <smfrench@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4c0c03ca
  5. 17 6月, 2010 2 次提交