linux-stable/drivers/infiniband/core
Avihai Horon cb916e7da9 RDMA/core: Let ib_find_gid() continue search even after empty entry
[ Upstream commit 483d805191 ]

Currently, ib_find_gid() will stop searching after encountering the first
empty GID table entry. This behavior is wrong since neither IB nor RoCE
spec enforce tightly packed GID tables.

For example, when a valid GID entry exists at index N, and if a GID entry
is empty at index N-1, ib_find_gid() will fail to find the valid entry.

Fix it by making ib_find_gid() continue searching even after encountering
missing entries.

Fixes: 5eb620c81c ("IB/core: Add helpers for uncached GID and P_Key searches")
Link: https://lore.kernel.org/r/e55d331b96cecfc2cf19803d16e7109ea966882d.1639055490.git.leonro@nvidia.com
Signed-off-by: Avihai Horon <avihaih@nvidia.com>
Reviewed-by: Mark Zhang <markzhang@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-01-27 09:00:52 +01:00
..
addr.c net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup 2020-05-20 08:17:02 +02:00
agent.c
agent.h
cache.c
cgroup.c
cm.c RDMA/cm: Fix an attempt to use non-valid pointer when cleaning timewait 2020-12-29 13:46:47 +01:00
cm_msgs.h
cma.c RDMA/cma: Fix rdma_resolve_route() memory leak 2021-07-20 16:17:45 +02:00
cma_configfs.c IB/cma: Fix ports memory leak in cma_configfs 2020-06-25 15:41:54 +02:00
core_priv.h
cq.c
device.c RDMA/core: Let ib_find_gid() continue search even after empty entry 2022-01-27 09:00:52 +01:00
fmr_pool.c
iwcm.c RDMA/iwcm: Release resources if iw_cm module initialization fails 2021-09-22 11:45:26 +02:00
iwcm.h
iwpm_msg.c
iwpm_util.c
iwpm_util.h
mad.c RDMA/mad: Fix possible memory leak in ib_mad_post_receive_mads() 2020-06-30 15:38:04 -04:00
mad_priv.h
mad_rmpp.c
mad_rmpp.h
Makefile
mr_pool.c
multicast.c
netlink.c
nldev.c
opa_smi.h
packer.c
rdma_core.c
rdma_core.h
roce_gid_mgmt.c
rw.c
sa.h
sa_query.c
security.c RDMA/core: Ensure security pkey modify is not lost 2020-04-02 16:34:31 +02:00
smi.c
smi.h
sysfs.c
ucm.c
ucma.c RDMA/ucma: ucma_context reference leak in error path 2020-10-01 13:12:24 +02:00
ud_header.c
umem.c
umem_odp.c IB/umem: fix reference count leak in ib_umem_odp_get() 2020-07-29 07:42:52 +02:00
umem_rbtree.c
user_mad.c IB/umad: Return EIO in case of when device disassociated 2021-03-03 18:22:46 +01:00
uverbs.h
uverbs_cmd.c
uverbs_ioctl.c
uverbs_ioctl_merge.c
uverbs_main.c
uverbs_marshall.c RDMA/core: Don't infoleak GRH fields 2022-01-11 13:57:35 +01:00
uverbs_std_types.c
verbs.c RDMA/core: Fix reported speed and width 2020-09-23 10:46:25 +02:00