Re: [PATCH][V2] cxgb4: fix signed wrap around when decrementing index idx

From: David Miller
Date: Fri Sep 23 2016 - 07:25:45 EST


From: Colin King <colin.king@xxxxxxxxxxxxx>
Date: Thu, 22 Sep 2016 18:48:58 +0100

> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> Change predecrement compare to post decrement compare to avoid an
> unsigned integer wrap-around comparison when decrementing idx in
> the while loop.
>
> For example, when idx is zero, the current situation will
> predecrement idx in the while loop, wrapping idx to the maximum
> signed integer and cause out of bounds reads on rxq_info->msix_tbl[idx].
>
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>

Applied to net-next, thanks.