Re: [PATCH] wil6210: fix potential out-of-bounds read

From: Gustavo A. R. Silva
Date: Mon Apr 15 2019 - 13:29:52 EST




On 4/15/19 12:24 PM, merez@xxxxxxxxxxxxxx wrote:
> On 2019-04-15 17:56, Gustavo A. R. Silva wrote:
>> Notice that *rc* can evaluate to up to 5, include/linux/netdevice.h:
>>
>> enum gro_result {
>> ÂÂÂÂÂÂÂ GRO_MERGED,
>> ÂÂÂÂÂÂÂ GRO_MERGED_FREE,
>> ÂÂÂÂÂÂÂ GRO_HELD,
>> ÂÂÂÂÂÂÂ GRO_NORMAL,
>> ÂÂÂÂÂÂÂ GRO_DROP,
>> ÂÂÂÂÂÂÂ GRO_CONSUMED,
>> };
>> typedef enum gro_result gro_result_t;
>>
>> In case *rc* evaluates to 5, we end up having an out-of-bounds read
>> at drivers/net/wireless/ath/wil6210/txrx.c:821:
>>
>> ÂÂÂÂwil_dbg_txrx(wil, "Rx complete %d bytes => %s\n",
>> ÂÂÂÂÂÂÂÂÂÂÂÂ len, gro_res_str[rc]);
>>
>> Fix this by adding element "GRO_CONSUMED" to array gro_res_str.
>>
>> Addresses-Coverity-ID: 1444666 ("Out-of-bounds read")
>> Fixes: 194b482b5055 ("wil6210: Debug print GRO Rx result")
>> Signed-off-by: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>
>> ---
>> Âdrivers/net/wireless/ath/wil6210/txrx.c | 1 +
>> Â1 file changed, 1 insertion(+)
>
> Reviewed-by: Maya Erez <merez@xxxxxxxxxxxxxx>
>

Thanks, Maya.
--
Gustavo