1. 14 12月, 2020 4 次提交
  2. 04 12月, 2020 1 次提交
  3. 01 12月, 2020 1 次提交
  4. 23 10月, 2020 3 次提交
  5. 22 10月, 2020 2 次提交
  6. 16 10月, 2020 1 次提交
  7. 29 8月, 2020 1 次提交
  8. 24 8月, 2020 1 次提交
  9. 08 8月, 2020 1 次提交
    • W
      mm, treewide: rename kzfree() to kfree_sensitive() · 453431a5
      Waiman Long 提交于
      As said by Linus:
      
        A symmetric naming is only helpful if it implies symmetries in use.
        Otherwise it's actively misleading.
      
        In "kzalloc()", the z is meaningful and an important part of what the
        caller wants.
      
        In "kzfree()", the z is actively detrimental, because maybe in the
        future we really _might_ want to use that "memfill(0xdeadbeef)" or
        something. The "zero" part of the interface isn't even _relevant_.
      
      The main reason that kzfree() exists is to clear sensitive information
      that should not be leaked to other future users of the same memory
      objects.
      
      Rename kzfree() to kfree_sensitive() to follow the example of the recently
      added kvfree_sensitive() and make the intention of the API more explicit.
      In addition, memzero_explicit() is used to clear the memory to make sure
      that it won't get optimized away by the compiler.
      
      The renaming is done by using the command sequence:
      
        git grep -w --name-only kzfree |\
        xargs sed -i 's/kzfree/kfree_sensitive/'
      
      followed by some editing of the kfree_sensitive() kerneldoc and adding
      a kzfree backward compatibility macro in slab.h.
      
      [akpm@linux-foundation.org: fs/crypto/inline_crypt.c needs linux/slab.h]
      [akpm@linux-foundation.org: fix fs/crypto/inline_crypt.c some more]
      Suggested-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NWaiman Long <longman@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NMichal Hocko <mhocko@suse.com>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: "Serge E. Hallyn" <serge@hallyn.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: "Jason A . Donenfeld" <Jason@zx2c4.com>
      Link: http://lkml.kernel.org/r/20200616154311.12314-3-longman@redhat.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      453431a5
  10. 07 8月, 2020 1 次提交
  11. 03 8月, 2020 8 次提交
  12. 02 7月, 2020 5 次提交
  13. 04 6月, 2020 1 次提交
  14. 01 6月, 2020 6 次提交
    • J
      cifs: Standardize logging output · a0a3036b
      Joe Perches 提交于
      Use pr_fmt to standardize all logging for fs/cifs.
      
      Some logging output had no CIFS: specific prefix.
      
      Now all output has one of three prefixes:
      
      o CIFS:
      o CIFS: VFS:
      o Root-CIFS:
      
      Miscellanea:
      
      o Convert printks to pr_<level>
      o Neaten macro definitions
      o Remove embedded CIFS: prefixes from formats
      o Convert "illegal" to "invalid"
      o Coalesce formats
      o Add missing '\n' format terminations
      o Consolidate multiple cifs_dbg continuations into single calls
      o More consistent use of upper case first word output logging
      o Multiline statement argument alignment and wrapping
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      a0a3036b
    • S
      smb3: Add new parm "nodelete" · 82e9367c
      Steve French 提交于
      In order to handle workloads where it is important to make sure that
      a buggy app did not delete content on the drive, the new mount option
      "nodelete" allows standard permission checks on the server to work,
      but prevents on the client any attempts to unlink a file or delete
      a directory on that mount point.  This can be helpful when running
      a little understood app on a network mount that contains important
      content that should not be deleted.
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      CC: Stable <stable@vger.kernel.org>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      82e9367c
    • P
      cifs: get rid of unused parameter in reconn_setup_dfs_targets() · baf3f08e
      Paulo Alcantara 提交于
      The target iterator parameter "it" is not used in
      reconn_setup_dfs_targets(), so just remove it.
      Signed-off-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      baf3f08e
    • P
      cifs: handle hostnames that resolve to same ip in failover · e4af35fa
      Paulo Alcantara 提交于
      In order to support reconnect to hostnames that resolve to same ip
      address, besides relying on the currently set hostname to match DFS
      targets, attempt to resolve the targets and then match their addresses
      with the reconnected server ip address.
      
      For instance, if we have two hostnames "FOO" and "BAR", and both
      resolve to the same ip address, we would be able to handle failover in
      DFS paths like
      
          \\FOO\dfs\link1 -> [ \BAZ\share2 (*), \BAR\share1 ]
          \\FOO\dfs\link2 -> [ \BAZ\share2 (*), \FOO\share1 ]
      
      so when "BAZ" is no longer accessible, link1 and link2 would get
      reconnected despite having different target hostnames.
      Signed-off-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      e4af35fa
    • P
      cifs: set up next DFS target before generic_ip_connect() · aaa3aef3
      Paulo Alcantara 提交于
      If we mount a very specific DFS link
      
          \\FS0.FOO.COM\dfs\link -> \FS0\share1, \FS1\share2
      
      where its target list contains NB names ("FS0" & "FS1") rather than
      FQDN ones ("FS0.FOO.COM" & "FS1.FOO.COM"), we end up connecting to
      \FOO\share1 but server->hostname will have "FOO.COM".  The reason is
      because both "FS0" and "FS0.FOO.COM" resolve to same IP address and
      they share same TCP server connection, but "FS0.FOO.COM" was the first
      hostname set -- which is OK.
      
      However, if the echo thread timeouts and we still have a good
      connection to "FS0", in cifs_reconnect()
      
          rc = generic_ip_connect(server) -> success
          if (rc) {
                  ...
                  reconn_inval_dfs_target(server, cifs_sb, &tgt_list,
      	                            &tgt_it);
                  ...
           }
           ...
      
      it successfully reconnects to "FS0" server but does not set up next
      DFS target - which should be the same target server "\FS0\share1" -
      and server->hostname remains set to "FS0.FOO.COM" rather than "FS0",
      as reconn_inval_dfs_target() would have it set to "FS0" if called
      earlier.
      
      Finally, in __smb2_reconnect(), the reconnect of tcons would fail
      because tcon->ses->server->hostname (FS0.FOO.COM) does not match DFS
      target's hostname (FS0).
      
      Fix that by calling reconn_inval_dfs_target() before
      generic_ip_connect() so server->hostname will get updated correctly
      prior to reconnecting its tcons in __smb2_reconnect().
      
      With "cifs: handle hostnames that resolve to same ip in failover"
      patch
      
          - The above problem would not occur.
          - We could save an DNS query to find out that they both resolve to
            the same ip address.
      Signed-off-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      aaa3aef3
    • K
      cifs: handle "nolease" option for vers=1.0 · 8fd6e1d6
      Kenneth D'souza 提交于
      The "nolease" mount option is only supported for SMB2+ mounts.
      Fail with appropriate error message if vers=1.0 option is passed.
      Signed-off-by: NKenneth D'souza <kdsouza@redhat.com>
      Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      8fd6e1d6
  15. 29 5月, 2020 1 次提交
  16. 23 4月, 2020 1 次提交
    • P
      cifs: do not share tcons with DFS · 65303de8
      Paulo Alcantara 提交于
      This disables tcon re-use for DFS shares.
      
      tcon->dfs_path stores the path that the tcon should connect to when
      doing failing over.
      
      If that tcon is used multiple times e.g. 2 mounts using it with
      different prefixpath, each will need a different dfs_path but there is
      only one tcon. The other solution would be to split the tcon in 2
      tcons during failover but that is much harder.
      
      tcons could not be shared with DFS in cifs.ko because in a
      DFS namespace like:
      
                //domain/dfsroot -> /serverA/dfsroot, /serverB/dfsroot
      
                //serverA/dfsroot/link -> /serverA/target1/aa/bb
      
                //serverA/dfsroot/link2 -> /serverA/target1/cc/dd
      
      you can see that link and link2 are two DFS links that both resolve to
      the same target share (/serverA/target1), so cifs.ko will only contain a
      single tcon for both link and link2.
      
      The problem with that is, if we (auto)mount "link" and "link2", cifs.ko
      will only contain a single tcon for both DFS links so we couldn't
      perform failover or refresh the DFS cache for both links because
      tcon->dfs_path was set to either "link" or "link2", but not both --
      which is wrong.
      Signed-off-by: NPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      Reviewed-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      65303de8
  17. 21 4月, 2020 1 次提交
  18. 23 3月, 2020 1 次提交
    • E
      cifs: clear PF_MEMALLOC before exiting demultiplex thread · dc920277
      Eric Biggers 提交于
      Leaving PF_MEMALLOC set when exiting a kthread causes it to remain set
      during do_exit().  That can confuse things.  For example, if BSD process
      accounting is enabled and the accounting file has FS_SYNC_FL set and is
      located on an ext4 filesystem without a journal, then do_exit() can end
      up calling ext4_write_inode().  That triggers the
      WARN_ON_ONCE(current->flags & PF_MEMALLOC) there, as it assumes
      (appropriately) that inodes aren't written when allocating memory.
      
      This was originally reported for another kernel thread, xfsaild() [1].
      cifs_demultiplex_thread() also exits with PF_MEMALLOC set, so it's
      potentially subject to this same class of issue -- though I haven't been
      able to reproduce the WARN_ON_ONCE() via CIFS, since unlike xfsaild(),
      cifs_demultiplex_thread() is sent SIGKILL before exiting, and that
      interrupts the write to the BSD process accounting file.
      
      Either way, leaving PF_MEMALLOC set is potentially problematic.  Let's
      clean this up by properly saving and restoring PF_MEMALLOC.
      
      [1] https://lore.kernel.org/r/0000000000000e7156059f751d7b@google.comSigned-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      dc920277