diff options
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.patch | 75 |
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 @@ | |||
1 | From aa9c7fd565d04120156ef720235e9a759638606a Mon Sep 17 00:00:00 2001 | ||
2 | From: Pontus Fuchs <pontus.fuchs@gmail.com> | ||
3 | Date: Tue, 18 Oct 2011 09:23:41 +0200 | ||
4 | Subject: [PATCH 09/49] wl12xx: Validate FEM index from ini file and FW | ||
5 | |||
6 | commit 2131d3c2f99b081806fdae7662c92fe6acda52af upstream. | ||
7 | |||
8 | Check for out of bound FEM index to prevent reading beyond ini | ||
9 | memory end. | ||
10 | |||
11 | Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> | ||
12 | Reviewed-by: Luciano Coelho <coelho@ti.com> | ||
13 | Signed-off-by: Luciano Coelho <coelho@ti.com> | ||
14 | Signed-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 | |||
19 | diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c | ||
20 | index 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 | -- | ||
74 | 1.7.7.4 | ||
75 | |||