]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/iwcm: Fix iwcm work deallocation
authorBernard Metzler <bmt@zurich.ibm.com>
Mon, 2 Mar 2020 18:16:14 +0000 (19:16 +0100)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 4 Mar 2020 18:28:25 +0000 (14:28 -0400)
commit9fb828ff158dd132087acb3824f3d16917771f74
treec4026b771d548418d8d98817078eb57846156ddf
parent11c1bd303bed4b64db6ad46614fd89ee8ce6a4db
RDMA/iwcm: Fix iwcm work deallocation

The dealloc_work_entries() function must update the work_free_list pointer
while freeing its entries, since potentially called again on same list. A
second iteration of the work list caused system crash. This happens, if
work allocation fails during cma_iw_listen() and free_cm_id() tries to
free the list again during cleanup.

Fixes: a76bc45d391b ("RDMA: iWARP Connection Manager.")
Link: https://lore.kernel.org/r/20200302181614.17042-1-bmt@zurich.ibm.com
Reported-by: syzbot+cb0c054eabfba4342146@syzkaller.appspotmail.com
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/iwcm.c