1. 13 2月, 2013 9 次提交
  2. 21 12月, 2012 3 次提交
  3. 18 12月, 2012 1 次提交
  4. 12 12月, 2012 5 次提交
    • P
      CIFS: Fix write after setting a read lock for read oplock files · c299dd0e
      Pavel Shilovsky 提交于
      If we have a read oplock and set a read lock in it, we can't write to the
      locked area - so, filemap_fdatawrite may fail with a no information for a
      userspace application even if we request a write to non-locked area. Fix
      this by populating the page cache without marking affected pages dirty
      after a successful write directly to the server.
      
      Also remove CONFIG_CIFS_SMB2 ifdefs because it's suitable for both CIFS
      and SMB2 protocols.
      Signed-off-by: NPavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      c299dd0e
    • J
      cifs: parse the device name into UNC and prepath · d387a5c5
      Jeff Layton 提交于
      This should fix a regression that was introduced when the new mount
      option parser went in. Also, when the unc= and prefixpath= options
      are provided, check their values against the ones we parsed from
      the device string. If they differ, then throw a warning that tells
      the user that we're using the values from the unc= option for now,
      but that that will change in 3.10.
      
      Pavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      d387a5c5
    • J
      cifs: fix up handling of prefixpath= option · 839db3d1
      Jeff Layton 提交于
      Currently the code takes care to ensure that the prefixpath has a
      leading '/' delimiter. What if someone passes us a prefixpath with a
      leading '\\' instead? The code doesn't properly handle that currently
      AFAICS.
      
      Let's just change the code to skip over any leading delimiter character
      when copying the prepath. Then, fix up the users of the prepath option
      to prefix it with the correct delimiter when they use it.
      
      Also, there's no need to limit the length of the prefixpath to 1k. If
      the server can handle it, why bother forbidding it?
      
      Pavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      839db3d1
    • J
      cifs: clean up handling of unc= option · 62a1a439
      Jeff Layton 提交于
      Make sure we free any existing memory allocated for vol->UNC, just in
      case someone passes in multiple unc= options.
      
      Get rid of the check for too long a UNC. The check for >300 bytes seems
      arbitrary. We later copy this into the tcon->treeName, for instance and
      it's a lot shorter than 300 bytes.
      
      Eliminate an extra kmalloc and copy as well. Just set the vol->UNC
      directly with the contents of match_strdup.
      
      Establish that the UNC should be stored with '\\' delimiters. Use
      convert_delimiter to change it in place in the vol->UNC.
      
      Finally, move the check for a malformed UNC into
      cifs_parse_mount_options so we can catch that situation earlier.
      
      Pavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      62a1a439
    • J
      cifs: fix SID binary to string conversion · 193cdd8a
      Jeff Layton 提交于
      The authority fields are supposed to be represented by a single 48-bit
      value. It's also supposed to represent the value as hex if it's equal to
      or greater than 2^32. This is documented in MS-DTYP, section 2.4.2.1.
      
      Also, fix up the max string length to account for this fix.
      Acked-by: NPavel Shilovsky <piastry@etersoft.ru>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      193cdd8a
  5. 10 12月, 2012 2 次提交
  6. 09 12月, 2012 5 次提交
    • J
      cifs: deal with id_to_sid embedded sid reply corner case · 1f630680
      Jeff Layton 提交于
      A SID could potentially be embedded inside of payload.value if there are
      no subauthorities, and the arch has 8 byte pointers. Allow for that
      possibility there.
      
      While we're at it, rephrase the "embedding" check in terms of
      key->payload to allow for the possibility that the union might change
      size in the future.
      Reviewed-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      1f630680
    • J
      cifs: fix hardcoded default security descriptor length · 7ee0b4c6
      Jeff Layton 提交于
      It was hardcoded to 192 bytes, which was not enough when the max number
      of subauthorities went to 15. Redefine this constant in terms of sizeof
      the structs involved, and rename it for better clarity.
      
      While we're at it, remove a couple more unused constants from cifsacl.h.
      Reviewed-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      7ee0b4c6
    • J
      cifs: extra sanity checking for cifs.idmap keys · 2ae03025
      Jeff Layton 提交于
      Now that we aren't so rigid about the length of the key being passed
      in, we need to be a bit more rigorous about checking the length of
      the actual data against the claimed length (a'la num_subauths field).
      
      Check for the case where userspace sends us a seemingly valid key
      with a num_subauths field that goes beyond the end of the array. If
      that happens, return -EIO and invalidate the key.
      
      Also change the other places where we check for malformed keys in this
      code to invalidate the key as well.
      Reviewed-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      2ae03025
    • J
      cifs: avoid extra allocation for small cifs.idmap keys · 41a9f1f6
      Jeff Layton 提交于
      The cifs.idmap keytype always allocates memory to hold the payload from
      userspace. In the common case where we're translating a SID to a UID or
      GID, we're allocating memory to hold something that's less than or equal
      to the size of a pointer.
      
      When the payload is the same size as a pointer or smaller, just store
      it in the payload.value union member instead. That saves us an extra
      allocation on the sid_to_id upcall.
      
      Note that we have to take extra care to check the datalen when we
      go to dereference the .data pointer in the union, but the callers
      now check that as a matter of course anyway.
      Reviewed-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      41a9f1f6
    • J
      cifs: simplify id_to_sid and sid_to_id mapping code · faa65f07
      Jeff Layton 提交于
      The cifs.idmap handling code currently causes the kernel to cache the
      data from userspace twice. It first looks in a rbtree to see if there is
      a matching entry for the given id. If there isn't then it calls
      request_key which then checks its cache and then calls out to userland
      if it doesn't have one. If the userland program establishes a mapping
      and downcalls with that info, it then gets cached in the keyring and in
      this rbtree.
      
      Aside from the double memory usage and the performance penalty in doing
      all of these extra copies, there are some nasty bugs in here too. The
      code declares four rbtrees and spinlocks to protect them, but only seems
      to use two of them. The upshot is that the same tree is used to hold
      (eg) uid:sid and sid:uid mappings. The comparitors aren't equipped to
      deal with that.
      
      I think we'd be best off to remove a layer of caching in this code. If
      this was originally done for performance reasons, then that really seems
      like a premature optimization.
      
      This patch does that -- it removes the rbtrees and the locks that
      protect them and simply has the code do a request_key call on each call
      into sid_to_id and id_to_sid. This greatly simplifies this code and
      should roughly halve the memory utilization from using the idmapping
      code.
      Reviewed-by: NShirish Pargaonkar <shirishpargaonkar@gmail.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      faa65f07
  7. 08 12月, 2012 2 次提交
  8. 06 12月, 2012 13 次提交