1. 06 4月, 2019 1 次提交
    • Y
      cifs: Fix NULL pointer dereference of devname · 36a3219e
      Yao Liu 提交于
      [ Upstream commit 68e2672f8fbd1e04982b8d2798dd318bf2515dd2 ]
      
      There is a NULL pointer dereference of devname in strspn()
      
      The oops looks something like:
      
        CIFS: Attempting to mount (null)
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
        ...
        RIP: 0010:strspn+0x0/0x50
        ...
        Call Trace:
         ? cifs_parse_mount_options+0x222/0x1710 [cifs]
         ? cifs_get_volume_info+0x2f/0x80 [cifs]
         cifs_setup_volume_info+0x20/0x190 [cifs]
         cifs_get_volume_info+0x50/0x80 [cifs]
         cifs_smb3_do_mount+0x59/0x630 [cifs]
         ? ida_alloc_range+0x34b/0x3d0
         cifs_do_mount+0x11/0x20 [cifs]
         mount_fs+0x52/0x170
         vfs_kern_mount+0x6b/0x170
         do_mount+0x216/0xdc0
         ksys_mount+0x83/0xd0
         __x64_sys_mount+0x25/0x30
         do_syscall_64+0x65/0x220
         entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Fix this by adding a NULL check on devname in cifs_parse_devname()
      Signed-off-by: NYao Liu <yotta.liu@ucloud.cn>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      36a3219e
  2. 07 2月, 2019 1 次提交
  3. 31 1月, 2019 1 次提交
  4. 03 10月, 2018 2 次提交
  5. 03 9月, 2018 1 次提交
  6. 10 8月, 2018 1 次提交
  7. 08 8月, 2018 4 次提交
  8. 06 7月, 2018 1 次提交
    • L
      cifs: Fix use after free of a mid_q_entry · 696e420b
      Lars Persson 提交于
      With protocol version 2.0 mounts we have seen crashes with corrupt mid
      entries. Either the server->pending_mid_q list becomes corrupt with a
      cyclic reference in one element or a mid object fetched by the
      demultiplexer thread becomes overwritten during use.
      
      Code review identified a race between the demultiplexer thread and the
      request issuing thread. The demultiplexer thread seems to be written
      with the assumption that it is the sole user of the mid object until
      it calls the mid callback which either wakes the issuer task or
      deletes the mid.
      
      This assumption is not true because the issuer task can be woken up
      earlier by a signal. If the demultiplexer thread has proceeded as far
      as setting the mid_state to MID_RESPONSE_RECEIVED then the issuer
      thread will happily end up calling cifs_delete_mid while the
      demultiplexer thread still is using the mid object.
      
      Inserting a delay in the cifs demultiplexer thread widens the race
      window and makes reproduction of the race very easy:
      
      		if (server->large_buf)
      			buf = server->bigbuf;
      
      +		usleep_range(500, 4000);
      
      		server->lstrp = jiffies;
      
      To resolve this I think the proper solution involves putting a
      reference count on the mid object. This patch makes sure that the
      demultiplexer thread holds a reference until it has finished
      processing the transaction.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NLars Persson <larper@axis.com>
      Acked-by: NPaulo Alcantara <palcantara@suse.de>
      Reviewed-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      696e420b
  9. 15 6月, 2018 2 次提交
  10. 07 6月, 2018 2 次提交
  11. 03 6月, 2018 2 次提交
  12. 01 6月, 2018 2 次提交
  13. 31 5月, 2018 2 次提交
    • S
      smb3: allow "posix" mount option to enable new SMB311 protocol extensions · b326614e
      Steve French 提交于
      If "posix" (or synonym "unix" for backward compatibility) specified on mount,
      and server advertises support for SMB3.11 POSIX negotiate context, then
      enable the new posix extensions on the tcon.  This can be viewed by
      looking for "posix" in the mount options displayed by /proc/mounts
      for that mount (ie if posix extensions allowed by server and the
      experimental POSIX extensions also requested on the mount by specifying
      "posix" at mount time).
      
      Also add check to warn user if conflicting unix/nounix or posix/noposix specified
      on mount.
      Signed-off-by: NSteve French <smfrench@gmail.com>
      b326614e
    • S
      cifs: allow disabling less secure legacy dialects · f92a720e
      Steve French 提交于
      To improve security it may be helpful to have additional ways to restrict the
      ability to override the default dialects (SMB2.1, SMB3 and SMB3.02) on mount
      with old dialects (CIFS/SMB1 and SMB2) since vers=1.0 (CIFS/SMB1) and vers=2.0
      are weaker and less secure.
      
      Add a module parameter "disable_legacy_dialects"
      (/sys/module/cifs/parameters/disable_legacy_dialects) which can be set to
      1 (or equivalently Y) to forbid use of vers=1.0 or vers=2.0 on mount.
      
      Also cleans up a few build warnings about globals for various module parms.
      Signed-off-by: NSteve French <smfrench@gmail.com>
      f92a720e
  14. 28 5月, 2018 2 次提交
    • S
      cifs: fix build break when CONFIG_CIFS_DEBUG2 enabled · 71992e62
      Steve French 提交于
      Previous patches "cifs: update calc_size to take a server argument"
      and
        "cifs: add server argument to the dump_detail method"
      were broken if CONFIG_CIFS_DEBUG2 enabled
      Signed-off-by: NSteve French <smfrench@gmail.com>
      CC: Ronnie Sahlberg <lsahlber@redhat.com>
      71992e62
    • S
      smb3: fix redundant opens on root · 3d4ef9a1
      Steve French 提交于
      In SMB2/SMB3 unlike in cifs we unnecessarily open the root of the share
      over and over again in various places during mount and path revalidation
      and also in statfs.  This patch cuts redundant traffic (opens and closes)
      by simply keeping the directory handle for the root around (and reopening
      it as needed on reconnect), so query calls don't require three round
      trips to copmlete - just one, and eases load on network, client and
      server (on mount alone, cuts network traffic by more than a third).
      
      Also add a new cifs mount parm "nohandlecache" to allow users whose
      servers might have resource constraints (eg in case they have a server
      with so many users connecting to it that this extra handle per mount
      could possibly be a resource concern).
      Signed-off-by: NSteve French <smfrench@gmail.com>
      Reviewed-by: NRonnie Sahlberg <lsahlber@redhat.com>
      3d4ef9a1
  15. 10 5月, 2018 1 次提交
  16. 24 4月, 2018 1 次提交
  17. 13 4月, 2018 2 次提交
  18. 03 4月, 2018 1 次提交
  19. 02 4月, 2018 1 次提交
  20. 27 1月, 2018 3 次提交
  21. 25 1月, 2018 7 次提交