* Coverity: mt76x0_phy_get_target_power(): Memory - illegal accesses
@ 2022-12-02 22:23 coverity-bot
0 siblings, 0 replies; only message in thread
From: coverity-bot @ 2022-12-02 22:23 UTC (permalink / raw)
To: Felix Fietkau
Cc: Lorenzo Bianconi, linux-wireless, Jakub Kicinski, Kalle Valo,
linux-mediatek, Matthias Brugger, Shayne Chen, Eric Dumazet,
David S. Miller, linux-kernel, Paolo Abeni, Sean Wang,
linux-arm-kernel, netdev, Ryder Lee, Gustavo A. R. Silva,
linux-next, linux-hardening
Hello!
This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20221202 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan
You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:
Thu Dec 1 17:29:12 2022 +0100
b376d96362d8 ("wifi: mt76: move mt76_rate_power from core to mt76x02 driver code")
Coverity reported the following:
*** CID 1527804: Memory - illegal accesses (OVERRUN)
drivers/net/wireless/mediatek/mt76/mt76x0/phy.c:645 in mt76x0_phy_get_target_power()
639 case 4:
640 /* vht rates */
641 tx_rate = info[1] & 0xf;
642 if (tx_rate > 9)
643 return -EINVAL;
644
vvv CID 1527804: Memory - illegal accesses (OVERRUN)
vvv Overrunning array "dev->rate_power.vht" of 2 bytes at byte offset 9 using index "tx_rate" (which evaluates to 9).
645 *target_power = cur_power + dev->rate_power.vht[tx_rate];
646 *target_pa_power = mt76x0_phy_get_rf_pa_mode(dev, 1, tx_rate);
647 break;
648 default:
649 /* ht rates */
650 tx_rate = info[1] & 0x7f;
If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527804 ("Memory - illegal accesses")
Fixes: b376d96362d8 ("wifi: mt76: move mt76_rate_power from core to mt76x02 driver code")
Thanks for your attention!
--
Coverity-bot
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-02 22:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02 22:23 Coverity: mt76x0_phy_get_target_power(): Memory - illegal accesses coverity-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).