aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-07-26 22:43:18 +0200
committerRafał Miłecki <rafal@milecki.pl>2018-07-26 23:21:46 +0200
commitb26214adb53da2816ff830b6cd6e31e1dafa2635 (patch)
treef7f053409a7c543bc5e62b4db960aa431bbc94da /package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch
parent7316515891532a9d5f0b70db31a95d06f7b00e94 (diff)
downloadupstream-b26214adb53da2816ff830b6cd6e31e1dafa2635.tar.gz
upstream-b26214adb53da2816ff830b6cd6e31e1dafa2635.tar.bz2
upstream-b26214adb53da2816ff830b6cd6e31e1dafa2635.zip
mac80211: backport brcmfmac fixes & debugging helpers from 4.18
The most important is probably regression fix in handling platform NVRAM. That bug stopped hardware from being properly calibrated breaking e.g. 5 GHz for Netgear R8000. Other than that it triggers memory dumps when experiencing firmware problems which is important for debugging purposes. Fixes: 7e8eb7f309a8 ("mac80211: backport brcmfmac firmware & clm_blob loading rework") Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch')
-rw-r--r--package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch b/package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch
new file mode 100644
index 0000000000..455009ef1d
--- /dev/null
+++ b/package/kernel/mac80211/patches/335-v4.18-0004-brcmfmac-validate-user-provided-data-for-memdump-bef.patch
@@ -0,0 +1,32 @@
+From d2af9b566554e01f9ad67b330ce569dbc130e5d3 Mon Sep 17 00:00:00 2001
+From: Franky Lin <franky.lin@broadcom.com>
+Date: Wed, 16 May 2018 14:12:01 +0200
+Subject: [PATCH] brcmfmac: validate user provided data for memdump before
+ copying
+
+In patch "brcmfmac: add support for sysfs initiated coredump", a new
+scenario of brcmf_debug_create_memdump was added in which the user of
+the function might not necessarily provide prefix data. Hence the
+function should not assume the data is always valid and should perform a
+check before copying.
+
+Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
+Signed-off-by: Franky Lin <franky.lin@broadcom.com>
+Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.c
+@@ -40,7 +40,8 @@ int brcmf_debug_create_memdump(struct br
+ if (!dump)
+ return -ENOMEM;
+
+- memcpy(dump, data, len);
++ if (data && len > 0)
++ memcpy(dump, data, len);
+ err = brcmf_bus_get_memdump(bus, dump + len, ramsize);
+ if (err) {
+ vfree(dump);