Re: [PATCH v2] RDMA/cma: Rollback source IP address if failing to acquire device

From: Jason Gunthorpe
Date: Mon Jan 14 2019 - 17:28:58 EST


On Wed, Jan 09, 2019 at 10:27:31PM -0800, Myungho Jung wrote:
> If cma_acquire_dev_by_src_ip() returns error in addr_handler(), the
> device state changes back to RDMA_CM_ADDR_BOUND but the resolved source
> IP address is still left. After that, if rdma_destroy_id() is called
> after rdma_listen(), the device is freed without removed from
> listen_any_list in cma_cancel_operation(). Revert to the previous IP
> address if acquiring device fails.
>
> Reported-by: syzbot+f3ce716af730c8f96637@xxxxxxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Myungho Jung <mhjungk@xxxxxxxxx>
> Reviewed-by: Parav Pandit <parav@xxxxxxxxxxxx>
> ---
> drivers/infiniband/core/cma.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)

Applied to for-next, thanks

Jason