Patch "brcmfmac: add length check in brcmf_cfg80211_escan_handler()" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
brcmfmac: add length check in brcmf_cfg80211_escan_handler()
to the 4.4-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-add-length-check-in-brcmf_cfg80211_escan_handler.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
17df6453d4be17910456e99c5a85025aa1b7a246Mon Sep 17 00:00:00 2001
From: Arend Van Spriel <[email protected]>
Date: Tue, 12 Sep 2017 10:47:53 +0200
Subject: brcmfmac: add length check in brcmf_cfg80211_escan_handler()
From: Arend Van Spriel <[email protected]>
commit 17df6453d4be17910456e99c5a85025aa1b7a246 upstream.
Upon handling the firmware notification for scans the length was checked properly and may result in corrupting kernel heap memory due to buffer overruns. This fix addresses CVE-2017-0786.
--- drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +15 -3
@@ -2914,6 +2914,7 @@ brcmf_cfg80211_escan_handler(struct brcmstruct brcmf_cfg80211_info *cfg = ifp->drvr->config;s32 status;struct brcmf_escan_result_le *escan_result_le; +u32 escan_buflen;struct brcmf_bss_info_le *bss_info_le;struct brcmf_bss_info_le *bss =NULL ;u32 bi_length;
@@ -2930,11 +2931,23 @@ brcmf_cfg80211_escan_handler(struct brcmif (status ==BRCMF_E_STATUS_PARTIAL ) {brcmf_dbg (SCAN ,"ESCAN Partial result\n" ); +if (e->datalen <sizeof (*escan_result_le)) { +brcmf_err ("invalid event data length\n" ); + goto exit; + } escan_result_le = (struct brcmf_escan_result_le *) data;if (!escan_result_le) {brcmf_err ("Invalid escan result (NULL pointer)\n" ); goto exit; } + escan_buflen =le32_to_cpu (escan_result_le->buflen); +if (escan_buflen >BRCMF_ESCAN_BUF_SIZE || + escan_buflen > e->datalen || + escan_buflen <sizeof (*escan_result_le)) { +brcmf_err ("Invalid escan buffer length: %d\n" , + escan_buflen); + goto exit; + }if (le16_to_cpu (escan_result_le->bss_count) !=1 ) {brcmf_err ("Invalid bss_count %d: ignoring\n" , escan_result_le->bss_count);
@@ -2951,9 +2964,8 @@ brcmf_cfg80211_escan_handler(struct brcm } bi_length =le32_to_cpu (bss_info_le->length); -if (bi_length != (le32_to_cpu (escan_result_le->buflen) - -WL_ESCAN_RESULTS_FIXED_SIZE )) { -brcmf_err ("Invalid bss_info length %d: ignoring\n" , +if (bi_length != escan_buflen -WL_ESCAN_RESULTS_FIXED_SIZE ) { +brcmf_err ("Ignoring invalid bss_info length: %d\n" , bi_length); goto exit; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/brcmfmac-add-length-check-in-brcmf_cfg80211_escan_handler.patch queue-4.4/brcmfmac-setup-passive-scan-if-requested-by-user-space.patch
Greg KH
maintainerQuoted 8 lines · On Tue, Oct 10, 2017 at 08:16:17PM +0200, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
brcmfmac: add length check in
brcmf_cfg80211_escan_handler()to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
Quoted 7 lines
The filename of the patch is:
brcmfmac-add-length-check-in-brcmf_cfg80211_escan_handler.patch
and it can be found in the queue-4.4 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Nope, breaks the build. If this should go to 4.4, can someone please provide a working backport for it?
thanks,
greg k-h
Quoted 13 lines · Greg KH
Quoted 12 lines · On Tue, Oct 10, 2017 at 08:16:17PM +0200, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
brcmfmac: add length check in
brcmf_cfg80211_escan_handler()to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
brcmfmac-add-length-check-in-brcmf_cfg80211_escan_handler.patch
and it can be found in the queue-4.4 subdirectory.
Quoted 6 lines
Quoted 3 lines
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Nope, breaks the build. If this should go to 4.4, can someone please provide a working backport for it?
been on sick leave, but I will look into it.
Thanks,
Arend