diff --git a/debian/changelog b/debian/changelog index fa7479039..298675447 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ linux (4.19.37-4) UNRELEASED; urgency=medium - libbpf: Build out-of-tree * README.source: Document the various makefiles and use of out-of-tree builds * [x86] lockdown,sysrq: Enable ALLOW_LOCKDOWN_LIFT_BY_SYSRQ (Closes: #929583) + * mwifiex: Fix possible buffer overflows at parsing bss descriptor + (CVE-2019-3846) [ Romain Perier ] * [rt] Update to 4.19.37-rt20 diff --git a/debian/patches/bugfix/all/mwifiex-fix-possible-buffer-overflows-at-parsing-bss.patch b/debian/patches/bugfix/all/mwifiex-fix-possible-buffer-overflows-at-parsing-bss.patch new file mode 100644 index 000000000..0c099d9ac --- /dev/null +++ b/debian/patches/bugfix/all/mwifiex-fix-possible-buffer-overflows-at-parsing-bss.patch @@ -0,0 +1,44 @@ +From: Takashi Iwai +Date: Wed, 29 May 2019 14:52:19 +0200 +Subject: mwifiex: Fix possible buffer overflows at parsing bss descriptor +Origin: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git/commit?id=13ec7f10b87f5fc04c4ccbd491c94c7980236a74 +Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2019-3846 + +mwifiex_update_bss_desc_with_ie() calls memcpy() unconditionally in +a couple places without checking the destination size. Since the +source is given from user-space, this may trigger a heap buffer +overflow. + +Fix it by putting the length check before performing memcpy(). + +This fix addresses CVE-2019-3846. + +Reported-by: huangwen +Signed-off-by: Takashi Iwai +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/marvell/mwifiex/scan.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/net/wireless/marvell/mwifiex/scan.c b/drivers/net/wireless/marvell/mwifiex/scan.c +index 935778ec9a1b..64ab6fe78c0d 100644 +--- a/drivers/net/wireless/marvell/mwifiex/scan.c ++++ b/drivers/net/wireless/marvell/mwifiex/scan.c +@@ -1247,6 +1247,8 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, + } + switch (element_id) { + case WLAN_EID_SSID: ++ if (element_len > IEEE80211_MAX_SSID_LEN) ++ return -EINVAL; + bss_entry->ssid.ssid_len = element_len; + memcpy(bss_entry->ssid.ssid, (current_ptr + 2), + element_len); +@@ -1256,6 +1258,8 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, + break; + + case WLAN_EID_SUPP_RATES: ++ if (element_len > MWIFIEX_SUPPORTED_RATES) ++ return -EINVAL; + memcpy(bss_entry->data_rates, current_ptr + 2, + element_len); + memcpy(bss_entry->supported_rates, current_ptr + 2, diff --git a/debian/patches/series b/debian/patches/series index 4bbb5a7cf..29c0bfe21 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -217,6 +217,7 @@ bugfix/all/brcmfmac-assure-SSID-length-from-firmware-is-limited.patch bugfix/all/brcmfmac-add-subtype-check-for-event-handling-in-dat.patch bugfix/all/ext4-zero-out-the-unused-memory-region-in-the-extent.patch bugfix/all/Bluetooth-hidp-fix-buffer-overflow.patch +bugfix/all/mwifiex-fix-possible-buffer-overflows-at-parsing-bss.patch # Fix exported symbol versions bugfix/all/module-disable-matching-missing-version-crc.patch