Patch "wifi: mt76: mt7996: fix unintended sign extension of mt7996_hw_queue_read()" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: mt76: mt7996: fix unintended sign extension of mt7996_hw_queue_read()

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-mt76-mt7996-fix-unintended-sign-extension-of-mt.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 8330e40807f6533fd2d9c8ab409f8660e56d57e8
Author: Ryder Lee <ryder.lee@xxxxxxxxxxxx>
Date:   Wed Dec 7 15:30:04 2022 +0800

    wifi: mt76: mt7996: fix unintended sign extension of mt7996_hw_queue_read()
    
    [ Upstream commit 063cca0252b46970e7e9ca423d5e930be3179aa1 ]
    
    In the expression "map[i].qid << 24" starts as u8, but is promoted to
    "signed int", then sign-extended to type "unsigned long", which is not
    intended. Cast to u32 to avoid the sign extension.
    
    Reported-by: coverity-bot <keescook+coverity-bot@xxxxxxxxxxxx>
    Addresses-Coverity-ID: 1527813 ("Integer handling issues")
    Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
    Signed-off-by: Ryder Lee <ryder.lee@xxxxxxxxxxxx>
    Signed-off-by: Felix Fietkau <nbd@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c
index 99b23aef53a50..3d4fbbbcc2062 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c
@@ -457,7 +457,7 @@ mt7996_hw_queue_read(struct seq_file *s, u32 size,
 		if (val & BIT(map[i].index))
 			continue;
 
-		ctrl = BIT(31) | (map[i].pid << 10) | (map[i].qid << 24);
+		ctrl = BIT(31) | (map[i].pid << 10) | ((u32)map[i].qid << 24);
 		mt76_wr(dev, MT_FL_Q0_CTRL, ctrl);
 
 		head = mt76_get_field(dev, MT_FL_Q2_CTRL,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux