Skip to contentSkip to conversation

wil6210: fix potential out-of-bounds read

PATCH In review Gustavo A. R. Silva 3 participants 5 messages Apr 15, 2019 – Apr 29, 2019 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wil6210: fix potential out-of-bounds read

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")
---
 drivers/net/wireless/ath/wil6210/txrx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/wil6210/txrx.c +1 -0
index 4ccfd1404458..d74837cce67f 100644
@@ -750,6 +750,7 @@ void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev)
 		[GRO_HELD]		= "GRO_HELD",
 		[GRO_NORMAL]		= "GRO_NORMAL",
 		[GRO_DROP]		= "GRO_DROP",
+		[GRO_CONSUMED]		= "GRO_CONSUMED",
 	};
 
 	wil->txrx_ops.get_netif_rx_params(skb, &cid, &security);
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Gustavo A. R. Silva

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]);
Quoted 8 lines

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")
---
 drivers/net/wireless/ath/wil6210/txrx.c | 1 +
 1 file changed, 1 insertion(+)
Signature · 3 lines
Maya Erez
Qualcomm Israel, Inc. on behalf of Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
#2 lore raw
Quoted 21 lines · On 4/15/19 12:24 PM, [email protected] wrote:
Quoted 20 lines · Gustavo A. R. Silva

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.

Quoted 9 lines
Quoted 6 lines

Addresses-Coverity-ID: 1444666 ("Out-of-bounds read")

Fixes 194b482b5055 ("wil6210: Debug print GRO Rx result")

---
 drivers/net/wireless/ath/wil6210/txrx.c | 1 +

 1 file changed, 1 insertion(+)

Thanks, Maya.
--
Gustavo

#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 18 lines · Gustavo A. R. Silva

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]);
Quoted 7 lines

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")

Patch applied to ath-next branch of ath.git, thanks.

bfabdd699732 wil6210: fix potential out-of-bounds read

Signature · 3 lines
https://patchwork.kernel.org/patch/10901053/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#5 lore raw
In reply to a message not in the archive
Quoted 28 lines · Kalle Valo
Quoted 18 lines · Gustavo A. R. Silva

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]);
Quoted 7 lines

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")
Quoted 4 lines

Patch applied to ath-next branch of ath.git, thanks.

bfabdd699732 wil6210: fix potential out-of-bounds read

Awesome. :)

Thanks, Kalle.
--
Gustavo