1. 07 Apr, 2022 1 commit
    • Chuck Lever's avatar
      SUNRPC: Fix the svc_deferred_event trace class · 4d500445
      Chuck Lever authored
      Fix a NULL deref crash that occurs when an svc_rqst is deferred
      while the sunrpc tracing subsystem is enabled. svc_revisit() sets
      dr->xprt to NULL, so it can't be relied upon in the tracepoint to
      provide the remote's address.
      
      Unfortunately we can't revert the "svc_deferred_class" hunk in
      commit ece200dd ("sunrpc: Save remote presentation address in
      svc_xprt for trace events") because there is now a specific check
      of event format specifiers for unsafe dereferences. The warning
      that check emits is:
      
        event svc_defer_recv has unsafe dereference of argument 1
      
      A "%pISpc" format specifier with a "struct sockaddr *" is indeed
      flagged by this check.
      
      Instead, take the brute-force approach used by the svcrdma_qp_error
      tracepoint. Convert the dr::addr field into a presentation address
      in the TP_fast_assign() arm of the trace event, and store that as
      a string. This fix can be backported to -stable kernels.
      
      In the meantime, commit c6ced229 ("tracing: Update print fmt
      check to handle new __get_sockaddr() macro") is now in v5.18, so
      this wonky fix can be replaced with __sockaddr() and friends
      properly during the v5.19 merge window.
      
      Fixes: ece200dd ("sunrpc: Save remote presentation address in svc_xprt for trace events")
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      4d500445
  2. 06 Apr, 2022 1 commit
    • Chuck Lever's avatar
      SUNRPC: Fix NFSD's request deferral on RDMA transports · 773f91b2
      Chuck Lever authored
      Trond Myklebust reports an NFSD crash in svc_rdma_sendto(). Further
      investigation shows that the crash occurred while NFSD was handling
      a deferred request.
      
      This patch addresses two inter-related issues that prevent request
      deferral from working correctly for RPC/RDMA requests:
      
      1. Prevent the crash by ensuring that the original
         svc_rqst::rq_xprt_ctxt value is available when the request is
         revisited. Otherwise svc_rdma_sendto() does not have a Receive
         context available with which to construct its reply.
      
      2. Possibly since before commit 71641d99 ("svcrdma: Properly
         compute .len and .buflen for received RPC Calls"),
         svc_rdma_recvfrom() did not include the transport header in the
         returned xdr_buf. There should have been no need for svc_defer()
         and friends to save and restore that header, as of that commit.
         This issue is addressed in a backport-friendly way by simply
         having svc_rdma_recvfrom() set rq_xprt_hlen to zero
         unconditionally, just as svc_tcp_recvfrom() does. This enables
         svc_deferred_recv() to correctly reconstruct an RPC message
         received via RPC/RDMA.
      Reported-by: default avatarTrond Myklebust <trondmy@hammerspace.com>
      Link: https://lore.kernel.org/linux-nfs/82662b7190f26fb304eb0ab1bb04279072439d4e.camel@hammerspace.com/Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Cc: <stable@vger.kernel.org>
      773f91b2
  3. 31 Mar, 2022 2 commits
  4. 28 Mar, 2022 1 commit
  5. 20 Mar, 2022 1 commit
  6. 17 Mar, 2022 1 commit
  7. 15 Mar, 2022 2 commits
  8. 11 Mar, 2022 5 commits
  9. 28 Feb, 2022 21 commits
  10. 27 Feb, 2022 4 commits
  11. 26 Feb, 2022 1 commit
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 2293be58
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
      
       - rtla (Real-Time Linux Analysis tool):
          - fix typo in man page
          - Update API -e to -E before it is released
          - Error message fix and memory leak fix
      
       - Partially uninline trace event soft disable to shrink text
      
       - Fix function graph start up test
      
       - Have triggers affect the trace instance they are in and not top level
      
       - Have osnoise sleep in the units it says it uses
      
       - Remove unused ftrace stub function
      
       - Remove event probe redundant info from event in the buffer
      
       - Fix group ownership setting in tracefs
      
       - Ensure trace buffer is minimum size to prevent crashes
      
      * tag 'trace-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        rtla/osnoise: Fix error message when failing to enable trace instance
        rtla/osnoise: Free params at the exit
        rtla/hist: Make -E the short version of --entries
        tracing: Fix selftest config check for function graph start up test
        tracefs: Set the group ownership in apply_options() not parse_options()
        tracing/osnoise: Make osnoise_main to sleep for microseconds
        ftrace: Remove unused ftrace_startup_enable() stub
        tracing: Ensure trace buffer is at least 4096 bytes large
        tracing: Uninline trace_trigger_soft_disabled() partly
        eprobes: Remove redundant event type information
        tracing: Have traceon and traceoff trigger honor the instance
        tracing: Dump stacktrace trigger to the corresponding instance
        rtla: Fix systme -> system typo on man page
      2293be58