> -----Original Message----- > From: Guoqing Jiang <guoqing.jiang@xxxxxxxxx> > Sent: Thursday, 27 July 2023 16:04 > To: Bernard Metzler <BMT@xxxxxxxxxxxxxx>; jgg@xxxxxxxx; leon@xxxxxxxxxx > Cc: linux-rdma@xxxxxxxxxxxxxxx > Subject: [EXTERNAL] [PATCH 0/5] Fix potential issues for siw > > Hi, > > Several issues appeared if we rmmod siw module after failed to insert > the module (with manual change like below). > > --- a/drivers/infiniband/sw/siw/siw_main.c > +++ b/drivers/infiniband/sw/siw/siw_main.c > @@ -577,6 +577,7 @@ static __init int siw_init_module(void) > if (rv) > goto out_error; > > + goto out_error; > rdma_link_register(&siw_link_ops); > > Basically, these issues are double free, use before initalization or > null pointer dereference. For more details, pls review the individual > patch. > > Thanks, > Guoqing Hi Guoqing, very good catch, thank you. I was under the wrong assumption a module is not loaded if the init_module() returns a value. Acked-by: Bernard Metzler <bmt@xxxxxxxxxxxxxx> > > Guoqing Jiang (5): > RDMA/siw: Set siw_cm_wq to NULL after it is destroyed > RDMA/siw: Ensure siw_destroy_cpulist can be called more than once > RDMA/siw: Initialize siw_link_ops.list > RDMA/siw: Set siw_crypto_shash to NULL after it is freed > RDMA/siw: Don't call wake_up unconditionally in siw_stop_tx_thread > > drivers/infiniband/sw/siw/siw_cm.c | 4 +++- > drivers/infiniband/sw/siw/siw_main.c | 7 ++++++- > drivers/infiniband/sw/siw/siw_qp_tx.c | 7 ++++++- > 3 files changed, 15 insertions(+), 3 deletions(-) > > -- > 2.34.1