mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +03:00
[ipoib] Fix a race when chain-loading undionly.kpxe in IPoIB
The Infiniband link status change callback ipoib_link_state_changed() may be called while the IPoIB device is closed, in which case there will not be an IPoIB queue pair to be joined to the IPv4 broadcast group. This leads to NULL pointer dereferences in ib_mcast_attach() and ib_mcast_detach(). Fix by not attempting to join (or leave) the broadcast group unless we actually have an IPoIB queue pair. Signed-off-by: Wissam Shoukair <wissams@mellanox.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
committed by
Michael Brown
parent
fd18417cf1
commit
eb8df9a046
@@ -718,6 +718,9 @@ int ib_mcast_attach ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
||||
struct ib_multicast_gid *mgid;
|
||||
int rc;
|
||||
|
||||
/* Sanity check */
|
||||
assert ( qp != NULL );
|
||||
|
||||
/* Add to software multicast GID list */
|
||||
mgid = zalloc ( sizeof ( *mgid ) );
|
||||
if ( ! mgid ) {
|
||||
@@ -751,6 +754,9 @@ void ib_mcast_detach ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
||||
union ib_gid *gid ) {
|
||||
struct ib_multicast_gid *mgid;
|
||||
|
||||
/* Sanity check */
|
||||
assert ( qp != NULL );
|
||||
|
||||
/* Remove from hardware multicast GID list */
|
||||
ibdev->op->mcast_detach ( ibdev, qp, gid );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user