]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
wil6210: fix potential out-of-bounds read
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 15 Apr 2019 14:56:46 +0000 (09:56 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit8b9a3913a1fa0bd273d8b1fee5135d466f471884
tree14a95a616b590d608e13a296a8344fb6b4f72269
parent0c972e1ba727e735d9134019ccbd6c3796d670c5
wil6210: fix potential out-of-bounds read

BugLink: https://bugs.launchpad.net/bugs/1839036
[ Upstream commit bfabdd6997323adbedccb13a3fed1967fb8cf8f5 ]

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@embeddedor.com>
Reviewed-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/wireless/ath/wil6210/txrx.c