IB/rxe: Add a runtime check in alloc_index()
authorBart Van Assche <bart.vanassche@sandisk.com>
Tue, 10 Jan 2017 19:15:48 +0000 (11:15 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Oct 2017 08:26:04 +0000 (10:26 +0200)
commit0081b9e7fcf75e65496f85896d2c3bb42e2a4dd7
treebbd7b669b022dbb51b4de75ae46de9c77434d93c
parent2b7aec8839dfe6482b8f6e0b8be0951fc990e964
IB/rxe: Add a runtime check in alloc_index()

[ Upstream commit 642c7cbcaf2ffc1e27f67eda3dc47347ac5aff37 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/sw/rxe/rxe_pool.c