1. 01 6月, 2018 1 次提交
  2. 01 5月, 2018 1 次提交
  3. 23 12月, 2017 1 次提交
  4. 11 11月, 2017 1 次提交
    • P
      IB/core: Avoid crash on pkey enforcement failed in received MADs · 89548bca
      Parav Pandit 提交于
      Below kernel crash is observed when Pkey security enforcement fails on
      received MADs. This issue is reported in [1].
      
      ib_free_recv_mad() accesses the rmpp_list, whose initialization is
      needed before accessing it.
      When security enformcent fails on received MADs, MAD processing avoided
      due to security checks failed.
      
      OpenSM[3770]: SM port is down
      kernel: BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
      kernel: IP: ib_free_recv_mad+0x44/0xa0 [ib_core]
      kernel: PGD 0
      kernel: P4D 0
      kernel:
      kernel: Oops: 0002 [#1] SMP
      kernel: CPU: 0 PID: 2833 Comm: kworker/0:1H Tainted: P          IO    4.13.4-1-pve #1
      kernel: Hardware name: Dell       XS23-TY3        /9CMP63, BIOS 1.71 09/17/2013
      kernel: Workqueue: ib-comp-wq ib_cq_poll_work [ib_core]
      kernel: task: ffffa069c6541600 task.stack: ffffb9a729054000
      kernel: RIP: 0010:ib_free_recv_mad+0x44/0xa0 [ib_core]
      kernel: RSP: 0018:ffffb9a729057d38 EFLAGS: 00010286
      kernel: RAX: ffffa069cb138a48 RBX: ffffa069cb138a10 RCX: 0000000000000000
      kernel: RDX: ffffb9a729057d38 RSI: 0000000000000000 RDI: ffffa069cb138a20
      kernel: RBP: ffffb9a729057d60 R08: ffffa072d2d49800 R09: ffffa069cb138ae0
      kernel: R10: ffffa069cb138ae0 R11: ffffa072b3994e00 R12: ffffb9a729057d38
      kernel: R13: ffffa069d1c90000 R14: 0000000000000000 R15: ffffa069d1c90880
      kernel: FS:  0000000000000000(0000) GS:ffffa069dba00000(0000) knlGS:0000000000000000
      kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      kernel: CR2: 0000000000000008 CR3: 00000011f51f2000 CR4: 00000000000006f0
      kernel: Call Trace:
      kernel:  ib_mad_recv_done+0x5cc/0xb50 [ib_core]
      kernel:  __ib_process_cq+0x5c/0xb0 [ib_core]
      kernel:  ib_cq_poll_work+0x20/0x60 [ib_core]
      kernel:  process_one_work+0x1e9/0x410
      kernel:  worker_thread+0x4b/0x410
      kernel:  kthread+0x109/0x140
      kernel:  ? process_one_work+0x410/0x410
      kernel:  ? kthread_create_on_node+0x70/0x70
      kernel:  ? SyS_exit_group+0x14/0x20
      kernel:  ret_from_fork+0x25/0x30
      kernel: RIP: ib_free_recv_mad+0x44/0xa0 [ib_core] RSP: ffffb9a729057d38
      kernel: CR2: 0000000000000008
      
      [1] : https://www.spinics.net/lists/linux-rdma/msg56190.html
      
      Fixes: 47a2b338 ("IB/core: Enforce security on management datagrams")
      Cc: stable@vger.kernel.org # 4.13+
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Reported-by: NChris Blake <chrisrblake93@gmail.com>
      Reviewed-by: NDaniel Jurgens <danielj@mellanox.com>
      Reviewed-by: NHal Rosenstock <hal@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      89548bca
  5. 24 5月, 2017 1 次提交
    • D
      IB/core: Enforce security on management datagrams · 47a2b338
      Daniel Jurgens 提交于
      Allocate and free a security context when creating and destroying a MAD
      agent.  This context is used for controlling access to PKeys and sending
      and receiving SMPs.
      
      When sending or receiving a MAD check that the agent has permission to
      access the PKey for the Subnet Prefix of the port.
      
      During MAD and snoop agent registration for SMI QPs check that the
      calling process has permission to access the manage the subnet  and
      register a callback with the LSM to be notified of policy changes. When
      notificaiton of a policy change occurs recheck permission and set a flag
      indicating sending and receiving SMPs is allowed.
      
      When sending and receiving MADs check that the agent has access to the
      SMI if it's on an SMI QP.  Because security policy can change it's
      possible permission was allowed when creating the agent, but no longer
      is.
      Signed-off-by: NDaniel Jurgens <danielj@mellanox.com>
      Acked-by: NDoug Ledford <dledford@redhat.com>
      [PM: remove the LSM hook init code]
      Signed-off-by: NPaul Moore <paul@paul-moore.com>
      47a2b338
  6. 02 5月, 2017 3 次提交
  7. 26 4月, 2017 1 次提交
  8. 25 1月, 2017 1 次提交
  9. 15 12月, 2016 2 次提交
  10. 04 12月, 2016 1 次提交
  11. 08 10月, 2016 1 次提交
  12. 24 9月, 2016 1 次提交
  13. 07 6月, 2016 1 次提交
  14. 25 5月, 2016 1 次提交
  15. 20 1月, 2016 2 次提交
  16. 24 12月, 2015 1 次提交
    • D
      IB/mad: Ensure fairness in ib_mad_completion_handler · 0d6ed314
      Dean Luick 提交于
      It was found that when a process was rapidly sending MADs other processes could
      be hung in their unregister calls.
      
      This would happen when process A was injecting packets fast enough that the
      single threaded workqueue was never exiting ib_mad_completion_handler.
      Therefore when process B called flush_workqueue via the unregister call it
      would hang until process A stopped sending MADs.
      
      The fix is to periodically reschedule ib_mad_completion_handler after
      processing a large number of completions.  The number of completions chosen was
      decided based on the defaults for the recv queue size.  However, it was kept
      fixed such that increasing those queue sizes would not adversely affect
      fairness in the future.
      Reviewed-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDean Luick <dean.luick@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      0d6ed314
  17. 09 12月, 2015 1 次提交
    • H
      IB/mad: Require CM send method for everything except ClassPortInfo · 53370886
      Hal Rosenstock 提交于
      Receipt of CM MAD with other than the Send method for an attribute
      other than the ClassPortInfo attribute is invalid.
      
      CM attributes other than ClassPortInfo only use the send method.
      
      The SRP initiator does not maintain a timeout policy for CM connect
      requests relies on the CM layer to do that. The result was that
      the SRP initiator hung as the connect request never completed.
      
      A new SRP target has been observed to respond to Send CM REQ
      with GetResp of CM REQ with bad status. This is non conformant
      with IBA spec but exposes a vulnerability in the current MAD/CM
      code which will respond to the incoming GetResp of CM REQ as if
      it was a valid incoming Send of CM REQ rather than tossing
      this on the floor. It also causes the MAD layer not to
      retransmit the original REQ even though it has not received a REP.
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NHal Rosenstock <hal@mellanox.com>
      Reviewed-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      53370886
  18. 22 10月, 2015 1 次提交
  19. 08 10月, 2015 1 次提交
    • C
      IB: split struct ib_send_wr · e622f2f4
      Christoph Hellwig 提交于
      This patch split up struct ib_send_wr so that all non-trivial verbs
      use their own structure which embedds struct ib_send_wr.  This dramaticly
      shrinks the size of a WR for most common operations:
      
      sizeof(struct ib_send_wr) (old):	96
      
      sizeof(struct ib_send_wr):		48
      sizeof(struct ib_rdma_wr):		64
      sizeof(struct ib_atomic_wr):		96
      sizeof(struct ib_ud_wr):		88
      sizeof(struct ib_fast_reg_wr):		88
      sizeof(struct ib_bind_mw_wr):		96
      sizeof(struct ib_sig_handover_wr):	80
      
      And with Sagi's pending MR rework the fast registration WR will also be
      down to a reasonable size:
      
      sizeof(struct ib_fastreg_wr):		64
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com> [srp, srpt]
      Reviewed-by: Chuck Lever <chuck.lever@oracle.com> [sunrpc]
      Tested-by: NHaggai Eran <haggaie@mellanox.com>
      Tested-by: NSagi Grimberg <sagig@mellanox.com>
      Tested-by: NSteve Wise <swise@opengridcomputing.com>
      e622f2f4
  20. 31 8月, 2015 2 次提交
  21. 15 7月, 2015 2 次提交
  22. 13 6月, 2015 10 次提交
    • I
      IB/mad: Add final OPA MAD processing · 8e4349d1
      Ira Weiny 提交于
      For devices which support OPA MADs
      
         1) Use previously defined SMP support functions.
      
         2) Pass correct base version to ib_create_send_mad when processing OPA MADs.
      
         3) Process out_mad_key_index returned by agents for a response.  This is
            necessary because OPA SMP packets must carry a valid pkey.
      
         4) Carry the correct segment size (OPA vs IBTA) of RMPP messages within
            ib_mad_recv_wc.
      
         5) Handle variable length OPA MADs by:
      
              * Adjusting the 'fake' WC for locally routed SMP's to represent the
                proper incoming byte_len
              * out_mad_size is used from the local HCA agents
                      1) when sending agent responses on the wire
                      2) when passing responses through the local_completions
      		   function
      
      	NOTE: wc.byte_len includes the GRH length and therefore is different
      	      from the in_mad_size specified to the local HCA agents.
      	      out_mad_size should _not_ include the GRH length as it is added
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      8e4349d1
    • I
      IB/mad: Add partial Intel OPA MAD support · 548ead17
      Ira Weiny 提交于
      This patch is the first of 3 which adds processing of OPA MADs
      
      1) Add Intel Omni-Path Architecture defines
      2) Increase max management version to accommodate OPA
      3) update ib_create_send_mad
      	If the device supports OPA MADs and the MAD being sent is the OPA base
      	version alter the MAD size and sg lengths as appropriate
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      548ead17
    • I
      IB/mad: Add support for additional MAD info to/from drivers · 4cd7c947
      Ira Weiny 提交于
      In order to support alternate sized MADs (and variable sized MADs on OPA
      devices) add in/out MAD size parameters to the process_mad core call.
      
      In addition, add an out_mad_pkey_index to communicate the pkey index the driver
      wishes the MAD stack to use when sending OPA MAD responses.
      
      The out MAD size and the out MAD PKey index are required by the MAD
      stack to generate responses on OPA devices.
      
      Furthermore, the in and out MAD parameters are made generic by specifying them
      as ib_mad_hdr rather than ib_mad.
      
      Drivers are modified as needed and are protected by BUG_ON flags if the MAD
      sizes passed to them is incorrect.
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      4cd7c947
    • I
      IB/mad: Convert allocations from kmem_cache to kzalloc · c9082e51
      Ira Weiny 提交于
      This patch implements allocating alternate receive MAD buffers within the MAD
      stack.  Support for OPA to send/recv variable sized MADs is implemented later.
      
          1) Convert MAD allocations from kmem_cache to kzalloc
      
             kzalloc is more flexible to support devices with different sized MADs
             and research and testing showed that the current use of kmem_cache does
             not provide performance benefits over kzalloc.
      
          2) Change struct ib_mad_private to use a flex array for the mad data
          3) Allocate ib_mad_private based on the size specified by devices in
             rdma_max_mad_size.
          4) Carry the allocated size in ib_mad_private to be used when processing
             ib_mad_private objects.
          5) Alter DMA mappings based on the mad_size of ib_mad_private.
          6) Replace the use of sizeof and static defines as appropriate
          7) Add appropriate casts for the MAD data when calling processing
             functions.
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      c9082e51
    • I
      IB/core: Add ability for drivers to report an alternate MAD size. · 337877a4
      Ira Weiny 提交于
      Add max MAD size to the device immutable data set and have all drivers that
      support MADs report the current IB MAD size (IB_MGMT_MAD_SIZE) to the core.
      
      Verify MAD size data in both the MAD core and when reading the immutable data.
      
      OPA drivers will report alternate MAD sizes in subsequent patches.
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      337877a4
    • I
      IB/mad: Support alternate Base Versions when creating MADs · da2dfaa3
      Ira Weiny 提交于
      In preparation to support the new OPA MAD Base version, add a base version
      parameter to ib_create_send_mad and set it to IB_MGMT_BASE_VERSION for current
      users.
      
      Definition of the new base version and it's processing will occur in later
      patches.
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      da2dfaa3
    • I
      IB/mad: Split IB SMI handling from MAD Recv handler · e11ae8aa
      Ira Weiny 提交于
      Make a helper function to process Directed Route SMPs to be called by the IB
      MAD Recv Handler, ib_mad_recv_done_handler.
      
      This cleans up the MAD receive handler code a bit and allows for us to better
      share the SMP processing code between IB and OPA SMPs.
      
      IB and OPA SMPs share the same processing algorithm but have different header
      formats and permissive LID detection.  Therefore this and subsequent patches
      split the common processing code from the IB specific code in anticipation of
      sharing those algorithms with the OPA code.
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      e11ae8aa
    • I
      IB/mad cleanup: Generalize processing of MAD data · 83a1d228
      Ira Weiny 提交于
      ib_find_send_mad only needs access to the MAD header not the full IB MAD.
      Change the local variable to ib_mad_hdr and change the corresponding cast.
      
      This allows for clean usage of this function with both IB and OPA MADs because
      OPA MADs carry the same header as IB MADs.
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      83a1d228
    • I
      IB/mad cleanup: Clean up function params -- find_mad_agent · d94bd266
      Ira Weiny 提交于
      find_mad_agent only needs read only access to the MAD header.  Update the
      ib_mad pointer to be const ib_mad_hdr.  Adjust call tree.
      Signed-off-by: NIra Weiny <ira.weiny@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      d94bd266
    • M
      IB/core: Change ib_create_cq to use struct ib_cq_init_attr · 8e37210b
      Matan Barak 提交于
      Currently, ib_create_cq uses cqe and comp_vecotr instead
      of the extendible ib_cq_init_attr struct.
      
      Earlier patches already changed the vendors to work with
      ib_cq_init_attr. This patch changes the consumers too.
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      8e37210b
  23. 21 5月, 2015 3 次提交