Patch "brcmfmac: return error when getting invalid max_flowrings from dongle" has been added to the 6.0-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

    brcmfmac: return error when getting invalid max_flowrings from dongle

to the 6.0-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:
     brcmfmac-return-error-when-getting-invalid-max_flowr.patch
and it can be found in the queue-6.0 subdirectory.

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



commit 14c059eb4ac26adb8063bf1503a688d5977c49c4
Author: Wright Feng <wright.feng@xxxxxxxxxxx>
Date:   Wed Sep 28 22:10:00 2022 -0500

    brcmfmac: return error when getting invalid max_flowrings from dongle
    
    [ Upstream commit 2aca4f3734bd717e04943ddf340d49ab62299a00 ]
    
    When firmware hit trap at initialization, host will read abnormal
    max_flowrings number from dongle, and it will cause kernel panic when
    doing iowrite to initialize dongle ring.
    To detect this error at early stage, we directly return error when getting
    invalid max_flowrings(>256).
    
    Signed-off-by: Wright Feng <wright.feng@xxxxxxxxxxx>
    Signed-off-by: Chi-hsien Lin <chi-hsien.lin@xxxxxxxxxxx>
    Signed-off-by: Ian Lin <ian.lin@xxxxxxxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220929031001.9962-3-ian.lin@xxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index 7fc8d47f2281..5b1813c02411 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -1120,6 +1120,10 @@ static int brcmf_pcie_init_ringbuffers(struct brcmf_pciedev_info *devinfo)
 				BRCMF_NROF_H2D_COMMON_MSGRINGS;
 		max_completionrings = BRCMF_NROF_D2H_COMMON_MSGRINGS;
 	}
+	if (max_flowrings > 256) {
+		brcmf_err(bus, "invalid max_flowrings(%d)\n", max_flowrings);
+		return -EIO;
+	}
 
 	if (devinfo->dma_idx_sz != 0) {
 		bufsz = (max_submissionrings + max_completionrings) *



[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