linux/drivers/infiniband/ulp
Erez Shitrit 439000892e IB/ipoib: Avoid memory leak if the SA returns a different DGID
The ipoib path database is organized around DGIDs from the LLADDR, but the
SA is free to return a different GID when asked for path. This causes a
bug because the SA's modified DGID is copied into the database key, even
though it is no longer the correct lookup key, causing a memory leak and
other malfunctions.

Ensure the database key does not change after the SA query completes.

Demonstration of the bug is as  follows
ipoib wants to send to GID fe80:0000:0000:0000:0002:c903:00ef:5ee2, it
creates new record in the DB with that gid as a key, and issues a new
request to the SM.
Now, the SM from some reason returns path-record with other SGID (for
example, 2001:0000:0000:0000:0002:c903:00ef:5ee2 that contains the local
subnet prefix) now ipoib will overwrite the current entry with the new
one, and if new request to the original GID arrives ipoib  will not find
it in the DB (was overwritten) and will create new record that in its
turn will also be overwritten by the response from the SM, and so on
till the driver eats all the device memory.

Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2017-12-18 15:37:05 -07:00
..
ipoib IB/ipoib: Avoid memory leak if the SA returns a different DGID 2017-12-18 15:37:05 -07:00
iser Merge branch 'for-next-early' into for-next 2017-10-18 13:07:13 -04:00
isert Updates for 4.15 kernel merge window 2017-11-15 14:54:53 -08:00
opa_vnic IB/opa_vnic: Add routing control information 2017-09-27 11:21:57 -04:00
srp IB/srp: replace custom implementation of hex2bin() 2017-12-11 16:19:45 -07:00
srpt Updates for 4.15 kernel merge window 2017-11-15 14:54:53 -08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00