]> git.baikalelectronics.ru Git - kernel.git/commit
IB/core: Fix memory corruption in ib_cache_gid_set_default_gid
authorDoron Tsur <doront@mellanox.com>
Thu, 15 Oct 2015 12:01:02 +0000 (15:01 +0300)
committerDoug Ledford <dledford@redhat.com>
Thu, 15 Oct 2015 16:35:54 +0000 (12:35 -0400)
commit9dbfb4dcbcc4cf728a270a8eedcb1d494cbb902a
tree292d5bc17607c3ca26d12fc1a612f007af0015bb
parent26e44087d28cab624e5d28fcd1c17ddff32268e7
IB/core: Fix memory corruption in ib_cache_gid_set_default_gid

When ib_cache_gid_set_default_gid is called from several threads,
updating the table could make find_gid fail, therefore a negative
index will be retruned and an invalid table entry will be used.
Locking find_gid as well fixes this problem.

Fixes: e94cc05b8433 ('IB/core: Add RoCE GID table management')
Signed-off-by: Doron Tsur <doront@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/cache.c