summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0009-wl12xx-Validate-FEM-index-from-ini-file-and-FW.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0009-wl12xx-Validate-FEM-index-from-ini-file-and-FW.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0009-wl12xx-Validate-FEM-index-from-ini-file-and-FW.patch75
1 files changed, 75 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0009-wl12xx-Validate-FEM-index-from-ini-file-and-FW.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0009-wl12xx-Validate-FEM-index-from-ini-file-and-FW.patch
new file mode 100644
index 00000000..3380e52b
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.1/0009-wl12xx-Validate-FEM-index-from-ini-file-and-FW.patch
@@ -0,0 +1,75 @@
1From aa9c7fd565d04120156ef720235e9a759638606a Mon Sep 17 00:00:00 2001
2From: Pontus Fuchs <pontus.fuchs@gmail.com>
3Date: Tue, 18 Oct 2011 09:23:41 +0200
4Subject: [PATCH 09/49] wl12xx: Validate FEM index from ini file and FW
5
6commit 2131d3c2f99b081806fdae7662c92fe6acda52af upstream.
7
8Check for out of bound FEM index to prevent reading beyond ini
9memory end.
10
11Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
12Reviewed-by: Luciano Coelho <coelho@ti.com>
13Signed-off-by: Luciano Coelho <coelho@ti.com>
14Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15---
16 drivers/net/wireless/wl12xx/cmd.c | 22 ++++++++++++++++++++++
17 1 files changed, 22 insertions(+), 0 deletions(-)
18
19diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
20index a52299e..54a0d66 100644
21--- a/drivers/net/wireless/wl12xx/cmd.c
22+++ b/drivers/net/wireless/wl12xx/cmd.c
23@@ -120,6 +120,11 @@ int wl1271_cmd_general_parms(struct wl1271 *wl)
24 if (!wl->nvs)
25 return -ENODEV;
26
27+ if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) {
28+ wl1271_warning("FEM index from INI out of bounds");
29+ return -EINVAL;
30+ }
31+
32 gen_parms = kzalloc(sizeof(*gen_parms), GFP_KERNEL);
33 if (!gen_parms)
34 return -ENOMEM;
35@@ -143,6 +148,12 @@ int wl1271_cmd_general_parms(struct wl1271 *wl)
36 gp->tx_bip_fem_manufacturer =
37 gen_parms->general_params.tx_bip_fem_manufacturer;
38
39+ if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) {
40+ wl1271_warning("FEM index from FW out of bounds");
41+ ret = -EINVAL;
42+ goto out;
43+ }
44+
45 wl1271_debug(DEBUG_CMD, "FEM autodetect: %s, manufacturer: %d\n",
46 answer ? "auto" : "manual", gp->tx_bip_fem_manufacturer);
47
48@@ -162,6 +173,11 @@ int wl128x_cmd_general_parms(struct wl1271 *wl)
49 if (!wl->nvs)
50 return -ENODEV;
51
52+ if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) {
53+ wl1271_warning("FEM index from ini out of bounds");
54+ return -EINVAL;
55+ }
56+
57 gen_parms = kzalloc(sizeof(*gen_parms), GFP_KERNEL);
58 if (!gen_parms)
59 return -ENOMEM;
60@@ -186,6 +202,12 @@ int wl128x_cmd_general_parms(struct wl1271 *wl)
61 gp->tx_bip_fem_manufacturer =
62 gen_parms->general_params.tx_bip_fem_manufacturer;
63
64+ if (gp->tx_bip_fem_manufacturer >= WL1271_INI_FEM_MODULE_COUNT) {
65+ wl1271_warning("FEM index from FW out of bounds");
66+ ret = -EINVAL;
67+ goto out;
68+ }
69+
70 wl1271_debug(DEBUG_CMD, "FEM autodetect: %s, manufacturer: %d\n",
71 answer ? "auto" : "manual", gp->tx_bip_fem_manufacturer);
72
73--
741.7.7.4
75