1. 01 6月, 2018 3 次提交
  2. 31 5月, 2018 1 次提交
  3. 30 5月, 2018 1 次提交
  4. 29 5月, 2018 1 次提交
  5. 24 5月, 2018 4 次提交
  6. 23 5月, 2018 1 次提交
  7. 17 5月, 2018 5 次提交
  8. 16 5月, 2018 3 次提交
  9. 10 5月, 2018 2 次提交
  10. 04 5月, 2018 4 次提交
  11. 01 5月, 2018 2 次提交
  12. 28 4月, 2018 5 次提交
    • A
      IB/uverbs: Fix kernel crash during MR deregistration flow · 54e7e48b
      Ariel Levkovich 提交于
      This patch fixes a crash that happens due to access to an
      uninitialized DM pointer within the MR object.
      
      The change makes sure the DM pointer in the MR object is set to
      NULL during a non-DM MR creation to prevent a false indication
      that this MR is related to a DM in the dereg flow.
      
      Fixes: be934cca ("IB/uverbs: Add device memory registration ioctl support")
      Reported-by: NLijun Ou <oulijun@huawei.com>
      Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      54e7e48b
    • A
      IB/uverbs: Prevent reregistration of DM_MR to regular MR · 5ccbf63f
      Ariel Levkovich 提交于
      This patch adds a check in the ib_uverbs_rereg_mr flow to make
      sure there's no attempt to rereg a device memory MR to regular MR.
      In such case the command will fail with -EINVAL status.
      
      fixes: be934cca ("IB/uverbs: Add device memory registration ioctl support")
      Signed-off-by: NAriel Levkovich <lariel@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      5ccbf63f
    • C
      RDMA/iwpm: fix memory leak on map_info · f96416ce
      Colin Ian King 提交于
      In the cases where iwpm_hash_bucket is NULL and where function
      get_mapinfo_hash_bucket returns NULL then the map_info is never added
      to hash_bucket_head and hence there is a leak of map_info. Fix this
      by nullifying hash_bucket_head and if that is null we know that
      that map_info was not added to hash_bucket_head and hence map_info
      should be free'd.
      
      Detected by CoverityScan, CID#1222481 ("Resource Leak")
      
      Fixes: 30dc5e63 ("RDMA/core: Add support for iWARP Port Mapper user space service")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      f96416ce
    • P
      RDMA/cma: Fix use after destroy access to net namespace for IPoIB · 2918c1a9
      Parav Pandit 提交于
      There are few issues with validation of netdevice and listen id lookup
      for IB (IPoIB) while processing incoming CM request as below.
      
      1. While performing lookup of bind_list in cma_ps_find(), net namespace
      of the netdevice can get deleted in cma_exit_net(), resulting in use
      after free access of idr and/or net namespace structures.
      This lookup occurs from the workqueue context (and not userspace
      context where net namespace is always valid).
      
                 CPU0                              CPU1
                 ====                              ====
      
       bind_list = cma_ps_find();
                                           move netdevice to new namespace
                                           delete net namespace
                                              cma_exit_net()
                                                 idr_destroy(idr);
      
       [..]
       cma_find_listener(bind_list, ..);
      
      2. While netdevice is validated for IP address in given net namespace,
      netdevice's net namespace and/or ifindex can change in
      cma_get_net_dev() and cma_match_net_dev().
      
      Above issues are overcome by using rcu lock along with netdevice
      UP/DOWN state as described below.
      When a net namespace is getting deleted, netdevice is closed and
      shutdown before moving it back to init_net namespace.
      change_net_namespace() synchronizes with any existing use of netdevice
      before changing the netdev properties such as net or ifindex.
      Once netdevice IFF_UP flags is cleared, such fields are not guaranteed
      to be valid.
      Therefore, rcu lock along with netdevice state check ensures that,
      while route lookup and cm_id lookup is in progress, netdevice of
      interest won't migrate to any other net namespace.
      This ensures that associated net namespace of netdevice won't get
      deleted while rcu lock is held for netdevice which is in IFF_UP state.
      
      Fixes: fa20105e ("IB/cma: Add support for network namespaces")
      Fixes: 4be74b42 ("IB/cma: Separate port allocation to network namespaces")
      Fixes: f887f2ac ("IB/cma: Validate routing of incoming requests")
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      2918c1a9
    • M
      IB/uverbs: Fix validating mandatory attributes · f604db64
      Matan Barak 提交于
      Previously, if a method contained mandatory attributes in a namespace
      that wasn't given by the user, these attributes weren't validated.
      Fixing this by iterating over all specification namespaces.
      
      Fixes: fac9658c ("IB/core: Add new ioctl interface")
      Signed-off-by: NMatan Barak <matanb@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      f604db64
  13. 24 4月, 2018 3 次提交
    • P
      IB/core: Fix deleting default GIDs when changing mac adddress · dc5640f2
      Parav Pandit 提交于
      Before [1], When MAC address of the netdevice is changed, default GID is
      supposed to get deleted and added back which affects the node and/or port
      GUID in below sequence.
      
      netdevice_event()
      -> NETDEV_CHANGEADDR
         default_del_cmd()
            del_netdev_default_ips()
                bond_delete_netdev_default_gids()
                    ib_cache_gid_set_default_gid()
                        ib_cache_gid_del()
         add_cmd()
         [..]
      
      However, ib_cache_gid_del() was not getting invoked in non bonding
      scenarios because event_ndev and rdma_ndev are same.
      Therefore, fix such condition to ignore checking upper device when event
      ndev and rdma_dev are same; similar to bond_set_netdev_default_gids().
      
      Which this fix ib_cache_gid_del() is invoked correctly; however
      ib_cache_gid_del() doesn't find the default GID for deletion because
      find_gid() was given default_gid = false with
      GID_ATTR_FIND_MASK_DEFAULT set.
      But it was getting overwritten by ib_cache_gid_set_default_gid() later
      on as part of add_cmd().
      Therefore, mac address change used to work for default GID.
      
      With refactor series [1], this incorrect behavior is detected.
      
      Therefore,
      when deleting default GID, set default_gid and set MASK flag.
      when deleting IP based GID, clear default_gid and set MASK flag.
      
      [1] https://patchwork.kernel.org/patch/10319151/
      
      Fixes: 238fdf48 ("IB/core: Add RoCE table bonding support")
      Fixes: 598ff6ba ("IB/core: Refactor GID modify code for RoCE")
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      dc5640f2
    • P
      IB/core: Fix to avoid deleting IPv6 look alike default GIDs · 22c01ee4
      Parav Pandit 提交于
      When IPv6 link local address is removed, if it matches with the default
      GID, default GID(s)s gets removed which may not be a desired behavior.
      This behavior is introduced by refactor work in Fixes tag.
      
      When IPv6 link address is removed, removing its equivalent RoCEv2 GID
      which exactly matches with default RoCEv2 GID, is right thing to do.
      However achieving it correctly requires lot more changes, likely in
      roce_gid_mgmt.c and core/cache.c. This should be done as independent
      patch.
      
      Therefore, this patch preserves behavior of not deleteing default GIDs.
      This is done by providing explicit hint to consider default GID property
      using mask and default_gid; similar to add_gid().
      
      Fixes: 598ff6ba ("IB/core: Refactor GID modify code for RoCE")
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      22c01ee4
    • P
      IB/core: Don't allow default GID addition at non reseved slots · a66ed149
      Parav Pandit 提交于
      Default GIDs are marked reserved at the start of the GID table at index
      0 and 1 by gid_table_reserve_default().  Currently when default GID is
      requested, it can still allocates an empty slot which was not marked as
      RESERVED for default GID, which is incorrect.
      
      At least in current code flow of roce_gid_mgmt.c, in theory we can
      still request to allocate more than one/two default GIDs depending
      on how upper devices are setup.
      
      Therefore, it is better for cache layer to only allow our reserved slots
      to be used by default GID allocation requests.
      
      Fixes: 598ff6ba ("IB/core: Refactor GID modify code for RoCE")
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      a66ed149
  14. 23 4月, 2018 1 次提交
  15. 20 4月, 2018 1 次提交
  16. 18 4月, 2018 3 次提交
    • G
      IB/uverbs: Add missing braces in anonymous union initializers · e33514f2
      Geert Uytterhoeven 提交于
      With gcc-4.1.2:
      
          drivers/infiniband/core/uverbs_std_types_flow_action.c:366: error: unknown field ‘ptr’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:367: error: unknown field ‘type’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:367: warning: missing braces around initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:367: warning: (near initialization for ‘uverbs_flow_action_esp_keymat[0].<anonymous>.<anonymous>’)
          drivers/infiniband/core/uverbs_std_types_flow_action.c:368: error: unknown field ‘min_len’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:368: warning: excess elements in union initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:368: warning: (near initialization for ‘uverbs_flow_action_esp_keymat[0].<anonymous>’)
          drivers/infiniband/core/uverbs_std_types_flow_action.c:368: error: unknown field ‘len’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:368: warning: excess elements in union initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:368: warning: (near initialization for ‘uverbs_flow_action_esp_keymat[0].<anonymous>’)
          drivers/infiniband/core/uverbs_std_types_flow_action.c:369: error: unknown field ‘flags’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:369: warning: excess elements in union initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:369: warning: (near initialization for ‘uverbs_flow_action_esp_keymat[0].<anonymous>’)
          drivers/infiniband/core/uverbs_std_types_flow_action.c:376: error: unknown field ‘ptr’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:377: error: unknown field ‘type’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:377: warning: missing braces around initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:377: warning: (near initialization for ‘uverbs_flow_action_esp_replay[0].<anonymous>.<anonymous>’)
          drivers/infiniband/core/uverbs_std_types_flow_action.c:379: error: unknown field ‘len’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:379: warning: excess elements in union initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:379: warning: (near initialization for ‘uverbs_flow_action_esp_replay[0].<anonymous>’)
          drivers/infiniband/core/uverbs_std_types_flow_action.c:383: error: unknown field ‘ptr’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:384: error: unknown field ‘type’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:385: error: unknown field ‘min_len’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:385: warning: excess elements in union initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:385: warning: (near initialization for ‘uverbs_flow_action_esp_replay[1].<anonymous>’)
          drivers/infiniband/core/uverbs_std_types_flow_action.c:385: error: unknown field ‘len’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:385: warning: excess elements in union initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:385: warning: (near initialization for ‘uverbs_flow_action_esp_replay[1].<anonymous>’)
          drivers/infiniband/core/uverbs_std_types_flow_action.c:386: error: unknown field ‘flags’ specified in initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:386: warning: excess elements in union initializer
          drivers/infiniband/core/uverbs_std_types_flow_action.c:386: warning: (near initialization for ‘uverbs_flow_action_esp_replay[1].<anonymous>’)
      
      Add the missing braces to fix this.
      
      Fixes: 2eb9beae ("IB/uverbs: Add flow_action create and destroy verbs")
      Fixes: 7d12f8d5 ("IB/uverbs: Add modify ESP flow_action")
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      e33514f2
    • J
      RDMA/rdma_cm: Delete rdma_addr_client · ee6548d1
      Jason Gunthorpe 提交于
      The only thing it does is block module unload while work is posted from
      rdma_resolve_ip().
      
      However, this is not the right place to do this. The users of
      rdma_resolve_ip() must ensure their own module does not unload until
      rdma_resolve_ip() calls the callback, or until rdma_addr_cancel() is
      called.
      
      Similarly callers to rdma_addr_find_l2_eth_by_grh() must ensure their
      module does not unload while they are calling code.
      
      The only two users are already safe, so there is no need for this.
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      ee6548d1
    • J
      RDMA/rdma_cm: Make rdma_addr_cancel into a fence · 44e75052
      Jason Gunthorpe 提交于
      Currently rdma_addr_cancel does not prevent the callback from being used,
      this is surprising and hard to reason about. There does not appear to be a
      bug here as the only user of this API does refcount properly, fixing it
      only to increase clarity.
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      44e75052