iser-target: Fix possible use-after-free in connection establishment error
Subsystems (3)
PATCH 1/1 iser-target: Fix possible use-after-free in connection establishment error
In case we fail to establish the connection we must drain our pre-posted login recieve work request before continuing safely with connection teardown.
--- drivers/infiniband/ulp/isert/ib_isert.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/ulp/isert/ib_isert.c +1 -0
@@ -741,6 +741,7 @@ isert_connect_error(struct rdma_cm_id *cma_id) {struct isert_conn *isert_conn = cma_id->qp->qp_context; +ib_drain_qp (isert_conn->qp);list_del_init (&isert_conn->node); isert_conn->cm_id =NULL ;isert_put_conn (isert_conn);
Signature · 6 lines
2.14.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Oops,
This should go via the target tree, CCing target-devel and nab
Quoted 16 lines · Sagi Grimberg
In case we fail to establish the connection we must drain our pre-posted login recieve work request before continuing safely with connection teardown.
Signed-off-by Sagi Grimberg <[email protected]>--- drivers/infiniband/ulp/isert/ib_isert.c | 1 + 1 file changed, 1 insertion(+)drivers/infiniband/ulp/isert/ib_isert.c +0
-0
drivers/infiniband/ulp/isert/ib_isert.c isert_connect_error(struct rdma_cm_id *cma_id) · line 747
Quoted 7 lines
drivers/infiniband/ulp/isert/ib_isert.c +1
-0@@ -741,6 +741,7 @@ isert_connect_error(struct rdma_cm_id *cma_id) {struct isert_conn *isert_conn = cma_id->qp->qp_context; +ib_drain_qp (isert_conn->qp);list_del_init (&isert_conn->node); isert_conn->cm_id =NULL ;isert_put_conn (isert_conn);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 19 lines · Sagi Grimberg
Quoted 18 lines
In case we fail to establish the connection we must drain our pre-posted login recieve work request before continuing safely with connection teardown.
Reported-by Amrani, Ram <[email protected]>Signed-off-by Sagi Grimberg <[email protected]>--- drivers/infiniband/ulp/isert/ib_isert.c | 1 + 1 file changed, 1 insertion(+)drivers/infiniband/ulp/isert/ib_isert.c +0
-0@@ -741,6 +741,7 @@ isert_connect_error(struct rdma_cm_id *cma_id) {struct isert_conn *isert_conn = cma_id->qp->qp_context;
Quoted 4 lines
drivers/infiniband/ulp/isert/ib_isert.c isert_connect_error(struct rdma_cm_id *cma_id) · line 747
Quoted 4 lines
drivers/infiniband/ulp/isert/ib_isert.c +1
-0+ib_drain_qp (isert_conn->qp);list_del_init (&isert_conn->node); isert_conn->cm_id =NULL ;isert_put_conn (isert_conn);
With this patch our test behaves as expected.
Thanks,
Ram
SGkgU2FnaSwNCg0KPiA+IFJlcG9ydGVkLWJ5OiBBbXJhbmksIFJhbSA8UmFtLkFtcmFuaUBjYXZp dW0uY29tPg0KPiA+IFNpZ25lZC1vZmYtYnk6IFNhZ2kgR3JpbWJlcmcgPHNhZ2lAZ3JpbWJlcmcu bWU+DQo+ID4gLS0tDQo+ID4gICBkcml2ZXJzL2luZmluaWJhbmQvdWxwL2lzZXJ0L2liX2lzZXJ0 LmMgfCAxICsNCj4gPiAgIDEgZmlsZSBjaGFuZ2VkLCAxIGluc2VydGlvbigrKQ0KPiA+DQo+ID4g ZGlmZiAtLWdpdCBhL2RyaXZlcnMvaW5maW5pYmFuZC91bHAvaXNlcnQvaWJfaXNlcnQuYyBiL2Ry aXZlcnMvaW5maW5pYmFuZC91bHAvaXNlcnQvaWJfaXNlcnQuYw0KPiA+IGluZGV4IGNlYWJkYjg1 ZGY4Yi4uOWQ0Nzg1YmEyNGNiIDEwMDY0NA0KPiA+IC0tLSBhL2RyaXZlcnMvaW5maW5pYmFuZC91 bHAvaXNlcnQvaWJfaXNlcnQuYw0KPiA+ICsrKyBiL2RyaXZlcnMvaW5maW5pYmFuZC91bHAvaXNl cnQvaWJfaXNlcnQuYw0KPiA+IEBAIC03NDEsNiArNzQxLDcgQEAgaXNlcnRfY29ubmVjdF9lcnJv cihzdHJ1Y3QgcmRtYV9jbV9pZCAqY21hX2lkKQ0KPiA+ICAgew0KPiA+ICAgCXN0cnVjdCBpc2Vy dF9jb25uICppc2VydF9jb25uID0gY21hX2lkLT5xcC0+cXBfY29udGV4dDsNCj4gPg0KPiA+ICsJ aWJfZHJhaW5fcXAoaXNlcnRfY29ubi0+cXApOw0KPiA+ICAgCWxpc3RfZGVsX2luaXQoJmlzZXJ0 X2Nvbm4tPm5vZGUpOw0KPiA+ICAgCWlzZXJ0X2Nvbm4tPmNtX2lkID0gTlVMTDsNCj4gPiAgIAlp c2VydF9wdXRfY29ubihpc2VydF9jb25uKTsNCj4gPg0KPiAtLQ0KDQpJZiBpdCdzIG5vdCBhbHJl YWR5IGNvbW1pdHRlZCwgY2FuIHlvdSBhZGQgYSAiRml4ZXM6IiBzbyBzdGFibGUgbWFpbnRhaW5l cnMgd2lsbCBjYXRjaCBpdD8NCg0KVGhhbmtzLA0KUmFtDQoNCg==
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Sagi Grimberg
maintainerQuoted 2 lines
If it's not already committed, can you add a "Fixes:" so stable maintainers will catch it?
I'm not sure at all that there is a clear cut commit that this fixes, both the target code and the rdma interface code changed a lot so I can't find any clear indication which broke this.
I can send a separate patch to stable from when we introduced ib_drain_qp though.
hi Guys,
did we forget taking this fix to mainline/stable or we found another solution ?
Quoted 14 lines · Sagi Grimberg
Quoted 2 lines
If it's not already committed, can you add a "Fixes:" so stable maintainers will catch it?
I'm not sure at all that there is a clear cut commit that this fixes, both the target code and the rdma interface code changed a lot so I can't find any clear indication which broke this.
I can send a separate patch to stable from when we introduced
ib_drain_qpthough.Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to [email protected] More majordomo info at https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvger.kernel.org%2Fmajordomo-info.html&data=02%7C01%7Cmaxg%40mellanox.com%7C18cac1be99bb4d99661c08d5377b08c6%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0%7C636475923920075321&sdata=WDJ6wr2o8jFyyGdHcLo06EhE18GTz9wUbF%2BezWzkGbc%3D&reserved=0
-Max.
Quoted 3 lines · Max Gurtovoy
hi Guys,
did we forget taking this fix to mainline/stable or we found another solution ?
I thought it was going to NAB's tree.. My mistake, I put it back into patchworks and it will get into for-next
Jason
Quoted 4 lines
I thought it was going to NAB's tree.. My mistake, I put it back into patchworks and it will get into for-next
Jason
Thanks.
BTW, you can use for-rc, as it is a bug fix.
Ram
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Jason Gunthorpe
Quoted 3 lines · Max Gurtovoy
hi Guys,
did we forget taking this fix to mainline/stable or we found another solution ?I thought it was going to NAB's tree.. My mistake, I put it back into patchworks and it will get into for-next
In fairness, the email thread said exactly that. But, it never got picked up by NAB. And being that it's in our tree and calling an rdma- core function, it can easily enough go through our tree, so I applied it to for-rc.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Quoted 6 lines · Doug Ledford
Quoted 5 lines · Jason Gunthorpe
Quoted 3 lines · Max Gurtovoy
hi Guys,
did we forget taking this fix to mainline/stable or we found another solution ?
Quoted 7 lines
Quoted 2 lines
I thought it was going to NAB's tree.. My mistake, I put it back into patchworks and it will get into for-next
In fairness, the email thread said exactly that. But, it never got picked up by NAB. And being that it's in our tree and calling an rdma- core function, it can easily enough go through our tree, so I applied it to for-rc.
Thanks Sagi + Ram, and Doug for picking this up.
Per the earlier discussion, it looks like this needs a stable CC, right..? As Sagi mentioned, it's not clear if this is a regression vs. generic RDMA READ/WRITE API logic, or a day one issue.
So how about adding a 4.7+ stable tag, to match commit a060b5629..?
Quoted 15 lines · Nicholas A. Bellinger
Quoted 6 lines · Doug Ledford
Quoted 5 lines · Jason Gunthorpe
Quoted 3 lines · Max Gurtovoy
hi Guys,
did we forget taking this fix to mainline/stable or we found another solution ?Quoted 7 lines
Quoted 2 lines
I thought it was going to NAB's tree.. My mistake, I put it back into patchworks and it will get into for-next
In fairness, the email thread said exactly that. But, it never got picked up by NAB. And being that it's in our tree and calling an rdma- core function, it can easily enough go through our tree, so I applied it to for-rc.
Quoted 7 lines
Thanks Sagi + Ram, and Doug for picking this up.
Per the earlier discussion, it looks like this needs a stable CC, right..? As Sagi mentioned, it's not clear if this is a regression vs. generic RDMA READ/WRITE API logic, or a day one issue.
So how about adding a 4.7+ stable tag, to match commit
a060b5629..?
That can be done:
Doug: I took your wip/dl-for-rc branch, revised the commit message and pushed it to for-rc.
Jason
Thanks Jason for picking it up, and sorry for the
late reply on this.
Quoted 3 lines
That can be done:
Fixes a060b5629ab0 ("IB/core: generic RDMA READ/WRITE API")
This patch is not the offending patch, if at all its this one:
But, the missing qp drain existed way before this commit.
I think any fixes tag would be confusing as there isn't a clear culprit for this one...
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html