IB/rxe: Fix resid update
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 8892e1d1-84ba-489b-d118-3599b9b50b0f-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
PATCH 1/2 IB/rxe: Fix resid update
From: Eyal Itkin <[email protected]>
Update the response's resid field when larger than MTU, instead of only updating the local resid variable.
drivers/infiniband/sw/rxe/rxe_resp.c +1 -1
@@ -479,7 +479,7 @@ static enum resp_states check_rkey(struct rxe_qp *qp, goto err; } - resid = mtu; + qp->resp.resid = mtu; }else {if (pktlen != resid) { state =RESPST_ERR_LENGTH ;
--
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 9 lines · Dan Carpenter
From: Eyal Itkin <[email protected]>
Update the response's resid field when larger than MTU, instead of only updating the local resid variable.
Fixes 8700e3e7c485 ("Soft RoCE driver")Signed-off-by Eyal Itkin <[email protected]>Signed-off-by Dan Carpenter <[email protected]>
Thanks,
Doug Ledford
AppliedQuoted 22 lines · Dan Carpenter
From: Eyal Itkin <[email protected]>
Update the response's resid field when larger than MTU, instead of only
updating the local resid variable.Fixes 8700e3e7c485 ("Soft RoCE driver")Signed-off-by Eyal Itkin <[email protected]>Signed-off-by Dan Carpenter <[email protected]>drivers/infiniband/sw/rxe/rxe_resp.c +0
-0@@ -479,7 +479,7 @@ static enum resp_states check_rkey(struct rxe_qp *qp, goto err; }drivers/infiniband/sw/rxe/rxe_resp.c +1
-1- resid = mtu; + qp->resp.resid = mtu;
Quoted 3 lines
} else {
if (pktlen != resid) { state =RESPST_ERR_LENGTH;
Applied, thanks.
Signature · 4 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
PATCH v2 2/2 IB/rxe: Fix mem_check_range integer overflow
In reply to a message not in the archiveFrom: Eyal Itkin <[email protected]>
Update the range check to avoid integer-overflow in edge case. Resolves CVE 2016-8636.
---
v2: I completely misread Eyal's first patch.
drivers/infiniband/sw/rxe/rxe_mr.c +5 -3
@@ -59,9 +59,11 @@ int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length)case RXE_MEM_TYPE_MR :case RXE_MEM_TYPE_FMR : -return ((iova < mem->iova) || - ((iova + length) > (mem->iova + mem->length))) ? - -EFAULT :0 ; +if (iova < mem->iova || + length > mem->length || + iova > mem->iova + mem->length - length) +return -EFAULT ; +return 0 ;default :return -EFAULT ;
--
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
Re: [patch 2/2 v2] IB/rxe: Fix mem_check_range integer overflow
Quoted 10 lines · Dan Carpenter
From: Eyal Itkin <[email protected]>
Update the range check to avoid integer-overflow in edge case. Resolves CVE 2016-8636.
Signed-off-by Eyal Itkin <[email protected]>Signed-off-by Dan Carpenter <[email protected]>---
v2: I completely misread Eyal's first patch.
Thanks,
Doug Ledford
AppliedRe: [patch 2/2 v2] IB/rxe: Fix mem_check_range integer overflow
In reply to Dan CarpenterQuoted 29 lines · Dan Carpenter
From: Eyal Itkin <[email protected]>
Update the range check to avoid integer-overflow in edge case. Resolves CVE 2016-8636.
Signed-off-by Eyal Itkin <[email protected]>Signed-off-by Dan Carpenter <[email protected]>---
v2: I completely misread Eyal's first patch.drivers/infiniband/sw/rxe/rxe_mr.c +0
-0@@ -59,9 +59,11 @@ int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length)
caseRXE_MEM_TYPE_MR:
caseRXE_MEM_TYPE_FMR:drivers/infiniband/sw/rxe/rxe_mr.c +0
-2- return ((iova < mem->iova) || - ((iova + length) > (mem->iova + mem-Quoted 1 line
length))) ?
drivers/infiniband/sw/rxe/rxe_mr.c +5
-1- -EFAULT : 0; +if (iova < mem->iova || + length > mem->length || + iova > mem->iova + mem->length - length) +return -EFAULT ; +return 0 ;
Quoted 3 lines
default:
return-EFAULT;
Thanks, applied.
Signature · 4 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD