1. 04 3月, 2013 1 次提交
    • E
      fs: Limit sys_mount to only request filesystem modules. · 7f78e035
      Eric W. Biederman 提交于
      Modify the request_module to prefix the file system type with "fs-"
      and add aliases to all of the filesystems that can be built as modules
      to match.
      
      A common practice is to build all of the kernel code and leave code
      that is not commonly needed as modules, with the result that many
      users are exposed to any bug anywhere in the kernel.
      
      Looking for filesystems with a fs- prefix limits the pool of possible
      modules that can be loaded by mount to just filesystems trivially
      making things safer with no real cost.
      
      Using aliases means user space can control the policy of which
      filesystem modules are auto-loaded by editing /etc/modprobe.d/*.conf
      with blacklist and alias directives.  Allowing simple, safe,
      well understood work-arounds to known problematic software.
      
      This also addresses a rare but unfortunate problem where the filesystem
      name is not the same as it's module name and module auto-loading
      would not work.  While writing this patch I saw a handful of such
      cases.  The most significant being autofs that lives in the module
      autofs4.
      
      This is relevant to user namespaces because we can reach the request
      module in get_fs_type() without having any special permissions, and
      people get uncomfortable when a user specified string (in this case
      the filesystem type) goes all of the way to request_module.
      
      After having looked at this issue I don't think there is any
      particular reason to perform any filtering or permission checks beyond
      making it clear in the module request that we want a filesystem
      module.  The common pattern in the kernel is to call request_module()
      without regards to the users permissions.  In general all a filesystem
      module does once loaded is call register_filesystem() and go to sleep.
      Which means there is not much attack surface exposed by loading a
      filesytem module unless the filesystem is mounted.  In a user
      namespace filesystems are not mounted unless .fs_flags = FS_USERNS_MOUNT,
      which most filesystems do not set today.
      Acked-by: NSerge Hallyn <serge.hallyn@canonical.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Reported-by: NKees Cook <keescook@google.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      7f78e035
  2. 28 2月, 2013 11 次提交
  3. 26 2月, 2013 11 次提交
  4. 23 2月, 2013 1 次提交
  5. 22 2月, 2013 7 次提交
  6. 20 2月, 2013 3 次提交
  7. 16 2月, 2013 4 次提交
  8. 15 2月, 2013 2 次提交
    • M
      IB/qib: Fix QP locate/remove race · bcc9b67a
      Mike Marciniszyn 提交于
      remove_qp() can execute concurrently with a qib_lookup_qpn() on
      another CPU, which in of itself, is ok, given the RCU locking.
      
      The issue is that remove_qp() NULLs out the qp->next field so that a
      qib_lookup_qpn() might fail to find a qp if it occurs after the one
      that is being deleted.  This is a momentary issue and subsequent
      qib_lookup_qpn() calls would find the qp's since the search restarts
      from the bucket head.  At scale, the issue might causes dropped
      packets and unnecessary retransmissions.
      
      The fix just deletes the qp->next NULL assignment to prevent the
      remove_qp() from hiding qp's from qib_lookup_qpn().
      Reviewed-by: NDean Luick <dean.luick@intel.com>
      Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      bcc9b67a
    • P
      RDMA/cxgb4: "cookie" can stay in host endianness · 710a3110
      Paul Bolle 提交于
      Work requests are passed between the host and the firmware with a
      "cookie".  This cookie is swapped to big-endian when passed to the
      firmware and back to host endianness on return.  This swapping seems
      to be implemented incorrectly.  Moreover, the byte swapping triggers
      GCC warnings on 32 bit:
      
          drivers/infiniband/hw/cxgb4/cm.c: In function ‘passive_ofld_conn_reply’:
          drivers/infiniband/hw/cxgb4/cm.c:2803:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
          drivers/infiniband/hw/cxgb4/cm.c: In function ‘send_fw_pass_open_req’:
          drivers/infiniband/hw/cxgb4/cm.c:2941:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
          [...]
      
      But byte swapping isn't needed as the firmware doesn't actually touch
      the cookie.  Dropping byte swapping makes the warnings go away too.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      710a3110