Commit b888433
rtw89: fix potentially access out of range of RF register array
[ Upstream commit 3010181 ]
The RF register array is used to help firmware to restore RF settings.
The original code can potentially access out of range, if the size is
between (RTW89_H2C_RF_PAGE_SIZE * RTW89_H2C_RF_PAGE_NUM + 1) to
((RTW89_H2C_RF_PAGE_SIZE + 1) * RTW89_H2C_RF_PAGE_NUM). Fortunately,
current used size doesn't fall into the wrong case, and the size will not
change if we don't update RF parameter.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211119055729.12826-1-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 91b10f3 commit b888433
1 file changed
+19
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
657 | 663 | | |
658 | 664 | | |
659 | 665 | | |
| |||
662 | 668 | | |
663 | 669 | | |
664 | 670 | | |
665 | | - | |
666 | | - | |
| 671 | + | |
| 672 | + | |
667 | 673 | | |
668 | 674 | | |
669 | 675 | | |
670 | | - | |
| 676 | + | |
671 | 677 | | |
672 | | - | |
673 | | - | |
674 | | - | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
675 | 682 | | |
676 | 683 | | |
677 | | - | |
678 | | - | |
679 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
680 | 687 | | |
681 | | - | |
| 688 | + | |
682 | 689 | | |
683 | | - | |
684 | | - | |
685 | | - | |
| 690 | + | |
686 | 691 | | |
687 | 692 | | |
688 | | - | |
| 693 | + | |
689 | 694 | | |
690 | 695 | | |
691 | 696 | | |
| |||
0 commit comments