]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Ensure that CM_ID exists prior to access it in ibcore.
authorhselasky <hselasky@FreeBSD.org>
Tue, 17 Jul 2018 09:13:11 +0000 (09:13 +0000)
committerhselasky <hselasky@FreeBSD.org>
Tue, 17 Jul 2018 09:13:11 +0000 (09:13 +0000)
commit745b9a714889e1577aa153a3aa8096bf757984f3
treefd386b3d9fcf426a2c4bba6af68aa8393f6b37c5
parentecd38d68da2b79e88770c47a97b6e2232ccb6221
Ensure that CM_ID exists prior to access it in ibcore.

Prior to access UCMA commands, the context should be initialized
and connected to CM_ID with ucma_create_id(). In case user skips
this step, he can provide non-valid ctx without CM_ID and cause
to multiple NULL dereferences.

Also there are situations where the create_id can be raced with
other user access, ensure that the context is only shared to
other threads once it is fully initialized to avoid the races.

Linux commit:
e8980d67d6017c8eee8f9c35f782c4bd68e004c9

MFC after: 1 week
Sponsored by: Mellanox Technologies
sys/ofed/drivers/infiniband/core/ib_ucma.c