Skip to content

Commit a9dbf5c

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Pull rdma fixes from Doug Ledford: "Third round of -rc fixes for 4.10 kernel: - two security related issues in the rxe driver - one compile issue in the RDMA uapi header" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: RDMA: Don't reference kernel private header from UAPI header IB/rxe: Fix mem_check_range integer overflow IB/rxe: Fix resid update
2 parents aca9fa0 + 646ebd4 commit a9dbf5c

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

drivers/infiniband/sw/rxe/rxe_mr.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length)
5959

6060
case RXE_MEM_TYPE_MR:
6161
case RXE_MEM_TYPE_FMR:
62-
return ((iova < mem->iova) ||
63-
((iova + length) > (mem->iova + mem->length))) ?
64-
-EFAULT : 0;
62+
if (iova < mem->iova ||
63+
length > mem->length ||
64+
iova > mem->iova + mem->length - length)
65+
return -EFAULT;
66+
return 0;
6567

6668
default:
6769
return -EFAULT;

drivers/infiniband/sw/rxe/rxe_resp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ static enum resp_states check_rkey(struct rxe_qp *qp,
479479
goto err2;
480480
}
481481

482-
resid = mtu;
482+
qp->resp.resid = mtu;
483483
} else {
484484
if (pktlen != resid) {
485485
state = RESPST_ERR_LENGTH;

include/uapi/rdma/ib_user_verbs.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#define IB_USER_VERBS_H
3838

3939
#include <linux/types.h>
40-
#include <rdma/ib_verbs.h>
4140

4241
/*
4342
* Increment this value if any changes that break userspace ABI
@@ -548,11 +547,17 @@ enum {
548547
};
549548

550549
enum {
551-
IB_USER_LEGACY_LAST_QP_ATTR_MASK = IB_QP_DEST_QPN
550+
/*
551+
* This value is equal to IB_QP_DEST_QPN.
552+
*/
553+
IB_USER_LEGACY_LAST_QP_ATTR_MASK = 1ULL << 20,
552554
};
553555

554556
enum {
555-
IB_USER_LAST_QP_ATTR_MASK = IB_QP_RATE_LIMIT
557+
/*
558+
* This value is equal to IB_QP_RATE_LIMIT.
559+
*/
560+
IB_USER_LAST_QP_ATTR_MASK = 1ULL << 25,
556561
};
557562

558563
struct ib_uverbs_ex_create_qp {

0 commit comments

Comments
 (0)