diff options
author | Colin Ian King <colin.king@canonical.com> | 2018-12-20 17:05:50 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-01-10 14:32:40 +0300 |
commit | 72255c807156adeb167444c4206c9e5eece22287 (patch) | |
tree | 2db0328e870a94eec8574bf7aa0f89f1a1582c3b /drivers/net/wireless/ray_cs.c | |
parent | ba2ffc96321c8433606ceeb85c9e722b8113e5a7 (diff) | |
download | linux-72255c807156adeb167444c4206c9e5eece22287.tar.xz |
ray_cs: fix array out-of-bounds access
Currently array element org[3] is being accessed, however the array is
only 3 elements in size, so this looks like an off-by-one out-of-bounds
error. Fix this by using org[2], which I believe was the original
intent.
This issue has existed in the driver back in the pre-git days, so no
idea when it was introduced.
Detected by CoverityScan, CID#711344 ("Out-of-bounds read")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ray_cs.c')
-rw-r--r-- | drivers/net/wireless/ray_cs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 33ad87528d9a..8b2741c8edf2 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -959,7 +959,7 @@ static int translate_frame(ray_dev_t *local, struct tx_msg __iomem *ptx, if (proto == htons(ETH_P_AARP) || proto == htons(ETH_P_IPX)) { /* This is the selective translation table, only 2 entries */ writeb(0xf8, - &((struct snaphdr_t __iomem *)ptx->var)->org[3]); + &((struct snaphdr_t __iomem *)ptx->var)->org[2]); } /* Copy body of ethernet packet without ethernet header */ memcpy_toio((void __iomem *)&ptx->var + |