Re: [PATCH RE-RESEND V2 for-next 5/5] IB/core: Fix deadlock on uverbs modify_qp error flow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Le jeudi 05 février 2015 à 13:53 +0200, Or Gerlitz a écrit :
> From: Moshe Lazer <moshel@xxxxxxxxxxxx>
> 
> The deadlock occurs on __uverbs_modify_qp, we take a lock (idr_read_qp)
> and in case of failure in ib_resolve_eth_l2_attrs we don't release
> it (put_qp_read). Fix that.
> 
> Issue: 355606
 ^^^^^^^^^^^^^^
I'm not sure this is relevant

> Fixes: ed4c54e5b4ba ("IB/core: Resolve Ethernet L2 addresses when modifying QP")
> Signed-off-by: Moshe Lazer <moshel@xxxxxxxxxxxx>
> Signed-off-by: Or Gerlitz <ogerlitz@xxxxxxxxxxxx>
> ---
>  drivers/infiniband/core/uverbs_cmd.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
> index ecb6430..a602ce9 100644
> --- a/drivers/infiniband/core/uverbs_cmd.c
> +++ b/drivers/infiniband/core/uverbs_cmd.c
> @@ -2097,20 +2097,21 @@ ssize_t ib_uverbs_modify_qp(struct ib_uverbs_file *file,
>  	if (qp->real_qp == qp) {
>  		ret = ib_resolve_eth_l2_attrs(qp, attr, &cmd.attr_mask);
>  		if (ret)
> -			goto out;
> +			goto release_qp;
>  		ret = qp->device->modify_qp(qp, attr,
>  			modify_qp_mask(qp->qp_type, cmd.attr_mask), &udata);
>  	} else {
>  		ret = ib_modify_qp(qp, attr, modify_qp_mask(qp->qp_type, cmd.attr_mask));
>  	}
>  
> -	put_qp_read(qp);
> -
>  	if (ret)
> -		goto out;
> +		goto release_qp;
>  
>  	ret = in_len;
>  
> +release_qp:
> +	put_qp_read(qp);
> +
>  out:
>  	kfree(attr);
>  

Regards.

-- 
Yann Droneaud
OPTEYA


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux