Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
librdmacm: prevent NULL pointer access during device initialization
When an RNIC with node_guid 0 is present, rdma_resolve_addr succeeds with ADDR_RESOLVED but subsequent device initialization can fail. This occurs because ucma_query_addr and ucma_query_route skip device initialization when the kernel returns a zero node_guid, leading to NULL pointer access in ucma_process_addr_resolved. Add explicit NULL checks for id->verbs after ucma_query_addr and ucma_query_route calls. Return ENODEV error if device initialization fails, ensuring proper error propagation instead of crashes. Note: ucma_query_addr must still return success in this case as it's used for probing AF_IB support, which intentionally skips device initialization. Fixes: 7162325 ("librdmacm: replace query_route call with separate queries") Signed-off-by: Luke Yue <[email protected]>
- Loading branch information