[lkml]   [2017]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.13 068/110] iw_cxgb4: remove the stid on listen create failure
4.13-stable review patch.  If anyone has any objections, please let me know.


From: Steve Wise <>

commit 8b1bbf36b7452c4acb20e91948eaa5e225ea6978 upstream.

If a listen create fails, then the server tid (stid) is incorrectly left
in the stid idr table, which can cause a touch-after-free if the stid
is looked up and the already freed endpoint is touched. So make sure
and remove it in the error path.

Signed-off-by: Steve Wise <>
Signed-off-by: Doug Ledford <>
Signed-off-by: Greg Kroah-Hartman <>

drivers/infiniband/hw/cxgb4/cm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -3463,7 +3463,7 @@ int c4iw_create_listen(struct iw_cm_id *
cm_id->provider_data = ep;
goto out;
+ remove_handle(ep->, &ep->>stid_idr, ep->stid);
cxgb4_free_stid(ep->>rdev.lldi.tids, ep->stid,

 \ /
  Last update: 2017-10-03 14:39    [W:0.316 / U:1.932 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site