Re: [PATCH 09/15] IB/rxe: Add a runtime check in alloc_index()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 02, 2017 at 10:41:58AM +0000, Bart Van Assche wrote:
> Since index values equal to or above 'range' can trigger memory
> corruption, complain if index >= range.

It looks like severe bug and the proper error folding is needed, if it
is a real situation.

>
> Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx>
> Cc: Moni Shoua <monis@xxxxxxxxxxxx>
> Cc: Andrew Boyer <andrew.boyer@xxxxxxxx>
> ---
>  drivers/infiniband/sw/rxe/rxe_pool.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_pool.c b/drivers/infiniband/sw/rxe/rxe_pool.c
> index 7d1e2862b928..75d11ee635ec 100644
> --- 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;
> -- 
> 2.11.0
> N?????r??y????b?X??ǧv?^?)޺{.n?+????{??ٚ?{ay?ʇڙ?,j??f???h???z??w??????j:+v???w?j?m????????zZ+?????ݢj"??!

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux