]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
RDMA/cma: Rollback source IP address if failing to acquire device
authorMyungho Jung <mhjungk@gmail.com>
Thu, 10 Jan 2019 06:27:31 +0000 (22:27 -0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit826d9f84eadab7a754e771ea235ee8e84f31c444
treed6e98eeff00c9f56af8555beb2483178b219f676
parent6e2ac3208cd628882f079ff98ebb7a4183f0e4cf
RDMA/cma: Rollback source IP address if failing to acquire device

BugLink: https://bugs.launchpad.net/bugs/1838116
commit 5fc01fb846bce8fa6d5f95e2625b8ce0f8e86810 upstream.

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@syzkaller.appspotmail.com
Signed-off-by: Myungho Jung <mhjungk@gmail.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/infiniband/core/cma.c