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

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



commit 61721e65c6d8a0915e5e23a9a313b3387f36c8ee
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 4e9d2b3659f0..6a5621f17bf5 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -1109,6 +1109,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