1. 27 Mar, 2020 3 commits
    • Chuck Lever's avatar
      svcrdma: Fix leak of transport addresses · 1a33d8a2
      Chuck Lever authored
      Kernel memory leak detected:
      
      unreferenced object 0xffff888849cdf480 (size 8):
        comm "kworker/u8:3", pid 2086, jiffies 4297898756 (age 4269.856s)
        hex dump (first 8 bytes):
          30 00 cd 49 88 88 ff ff                          0..I....
        backtrace:
          [<00000000acfc370b>] __kmalloc_track_caller+0x137/0x183
          [<00000000a2724354>] kstrdup+0x2b/0x43
          [<0000000082964f84>] xprt_rdma_format_addresses+0x114/0x17d [rpcrdma]
          [<00000000dfa6ed00>] xprt_setup_rdma_bc+0xc0/0x10c [rpcrdma]
          [<0000000073051a83>] xprt_create_transport+0x3f/0x1a0 [sunrpc]
          [<0000000053531a8e>] rpc_create+0x118/0x1cd [sunrpc]
          [<000000003a51b5f8>] setup_callback_client+0x1a5/0x27d [nfsd]
          [<000000001bd410af>] nfsd4_process_cb_update.isra.7+0x16c/0x1ac [nfsd]
          [<000000007f4bbd56>] nfsd4_run_cb_work+0x4c/0xbd [nfsd]
          [<0000000055c5586b>] process_one_work+0x1b2/0x2fe
          [<00000000b1e3e8ef>] worker_thread+0x1a6/0x25a
          [<000000005205fb78>] kthread+0xf6/0xfb
          [<000000006d2dc057>] ret_from_fork+0x3a/0x50
      
      Introduce a call to xprt_rdma_free_addresses() similar to the way
      that the TCP backchannel releases a transport's peer address
      strings.
      
      Fixes: 5d252f90 ("svcrdma: Add class for RDMA backwards direction transport")
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      1a33d8a2
    • Christophe JAILLET's avatar
      SUNRPC: Fix a potential buffer overflow in 'svc_print_xprts()' · b25b60d7
      Christophe JAILLET authored
      'maxlen' is the total size of the destination buffer. There is only one
      caller and this value is 256.
      
      When we compute the size already used and what we would like to add in
      the buffer, the trailling NULL character is not taken into account.
      However, this trailling character will be added by the 'strcat' once we
      have checked that we have enough place.
      
      So, there is a off-by-one issue and 1 byte of the stack could be
      erroneously overwridden.
      
      Take into account the trailling NULL, when checking if there is enough
      place in the destination buffer.
      
      
      While at it, also replace a 'sprintf' by a safer 'snprintf', check for
      output truncation and avoid a superfluous 'strlen'.
      
      Fixes: dc9a16e4 ("svc: Add /proc/sys/sunrpc/transport files")
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      [ cel: very minor fix to documenting comment
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      b25b60d7
    • J. Bruce Fields's avatar
      SUNRPC/cache: don't allow invalid entries to be flushed · 9a81ef42
      J. Bruce Fields authored
      Trond points out in commit 277f27e2 ("SUNRPC/cache: Allow
      garbage collection of invalid cache entries") that we allow invalid
      cache entries to persist indefinitely. That fix, however,
      reintroduces the problem fixed by Kinglong Mee's commit d6fc8821
      ("SUNRPC/Cache: Always treat the invalid cache as unexpired"), where
      an invalid cache entry is immediately removed by a flush before
      mountd responds to it. The result is that the server thread that
      should be waiting for mountd to fill in that entry instead gets an
      -ETIMEDOUT return from cache_check(). Symptoms are the server
      becoming unresponsive after a restart, reproduceable by running
      pynfs 4.1 test REBT5.
      
      Instead, take a compromise approach: allow invalid cache entries to
      be removed after they expire, but not to be removed by a cache
      flush.
      
      Fixes: 277f27e2 ("SUNRPC/cache: Allow garbage collection ... ")
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      9a81ef42
  2. 19 Mar, 2020 2 commits
  3. 16 Mar, 2020 34 commits
  4. 15 Mar, 2020 1 commit