projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43553b4
)
IB/rxe: Add a runtime check in alloc_index()
author
Bart Van Assche
<bart.vanassche@sandisk.com>
Tue, 10 Jan 2017 19:15:48 +0000
(11:15 -0800)
committer
Doug Ledford
<dledford@redhat.com>
Tue, 10 Jan 2017 21:52:47 +0000
(16:52 -0500)
Since index values equal to or above 'range' can trigger memory
corruption, complain if index >= range.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: Andrew Boyer <andrew.boyer@dell.com>
Cc: Moni Shoua <monis@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_pool.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/sw/rxe/rxe_pool.c
b/drivers/infiniband/sw/rxe/rxe_pool.c
index 7d1e2862b928c1ed5443526111ca54a97f29c0b9..75d11ee635ec2e28ff9278a9b4fb20f2ffc4cdd7 100644
(file)
--- a/
drivers/infiniband/sw/rxe/rxe_pool.c
+++ b/
drivers/infiniband/sw/rxe/rxe_pool.c
@@
-266,6
+266,7
@@
static u32 alloc_index(struct rxe_pool *pool)
if (index >= range)
index = find_first_zero_bit(pool->table, range);
+ WARN_ON_ONCE(index >= range);
set_bit(index, pool->table);
pool->last = index;
return index + pool->min_index;