summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorLiu Haitao <haitao.liu@windriver.com>2019-01-03 13:48:38 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-25 22:27:39 +0000
commita9c1c920c03d6bcd48a32452d13bc8424290e5d3 (patch)
treecf478770da62b5c4d7e9ea459e743f0abc42ad0a /meta
parent8c31da0835c4bec0b1b461a787ca722700dd47d4 (diff)
downloadpoky-a9c1c920c03d6bcd48a32452d13bc8424290e5d3.tar.gz
iw: fix parsing of WEP keys
The current iw4.14 has a fatal bug that could casue a Segmentation fault when parsing WEP keys. The issue has been fixed by upstream. [https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=0e39f109c4b8155697a12ef090b59cdb304c8c44] (From OE-Core rev: 6de9eb72f679dd8d8e4de972b1da978522cff8b4) (From OE-Core rev: fcc56a2e2689a1574b9b928f8cd53e28721e4b9f) Signed-off-by: Liu Haitao <haitao.liu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-connectivity/iw/iw/0001-connect-fix-parsing-of-WEP-keys.patch194
-rw-r--r--meta/recipes-connectivity/iw/iw_4.14.bb1
2 files changed, 195 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/iw/iw/0001-connect-fix-parsing-of-WEP-keys.patch b/meta/recipes-connectivity/iw/iw/0001-connect-fix-parsing-of-WEP-keys.patch
new file mode 100644
index 0000000000..8cf8f7ab38
--- /dev/null
+++ b/meta/recipes-connectivity/iw/iw/0001-connect-fix-parsing-of-WEP-keys.patch
@@ -0,0 +1,194 @@
1From 2a6be4166fd718be0694fe8a6e3f1013c125dee2 Mon Sep 17 00:00:00 2001
2From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
3Date: Tue, 12 Jun 2018 09:01:56 +0300
4Subject: [PATCH] connect: fix parsing of WEP keys
5
6The introduction of MFP options added a bug that causes a
7segmentation fault when parsing WEP keys.
8Fix that.
9
10Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
11Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12
13Upstream-Status: Backport
14[https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git/commit/?id=0e39f109c4b8155697a12ef090b59cdb304c8c44]
15Signed-off-by: Liu Haitao <haitao.liu@windriver.com>
16---
17 ap.c | 2 +-
18 connect.c | 7 ++-----
19 ibss.c | 2 +-
20 iw.h | 3 ++-
21 util.c | 36 ++++++++++++++++++------------------
22 5 files changed, 24 insertions(+), 26 deletions(-)
23
24diff --git a/ap.c b/ap.c
25index 4bab5b9..dcce402 100644
26--- a/ap.c
27+++ b/ap.c
28@@ -116,7 +116,7 @@ static int handle_start_ap(struct nl80211_state *state,
29 argv++;
30 argc--;
31
32- return parse_keys(msg, argv, argc);
33+ return parse_keys(msg, &argv, &argc);
34 nla_put_failure:
35 return -ENOSPC;
36 }
37diff --git a/connect.c b/connect.c
38index 339fc73..4a847a1 100644
39--- a/connect.c
40+++ b/connect.c
41@@ -54,13 +54,10 @@ static int iw_conn(struct nl80211_state *state,
42 argv++;
43 argc--;
44
45- ret = parse_keys(msg, argv, argc);
46+ ret = parse_keys(msg, &argv, &argc);
47 if (ret)
48 return ret;
49
50- argc -= 4;
51- argv += 4;
52-
53 if (!argc)
54 return 0;
55
56@@ -228,7 +225,7 @@ static int iw_auth(struct nl80211_state *state,
57 argv++;
58 argc--;
59
60- return parse_keys(msg, argv, argc);
61+ return parse_keys(msg, &argv, &argc);
62 nla_put_failure:
63 return -ENOSPC;
64 }
65diff --git a/ibss.c b/ibss.c
66index 84f1e95..d77fc92 100644
67--- a/ibss.c
68+++ b/ibss.c
69@@ -115,7 +115,7 @@ static int join_ibss(struct nl80211_state *state,
70 argv++;
71 argc--;
72
73- return parse_keys(msg, argv, argc);
74+ return parse_keys(msg, &argv, &argc);
75 nla_put_failure:
76 return -ENOSPC;
77 }
78diff --git a/iw.h b/iw.h
79index ee7ca20..8767ed3 100644
80--- a/iw.h
81+++ b/iw.h
82@@ -180,7 +180,8 @@ int parse_hex_mask(char *hexmask, unsigned char **result, size_t *result_len,
83 unsigned char **mask);
84 unsigned char *parse_hex(char *hex, size_t *outlen);
85
86-int parse_keys(struct nl_msg *msg, char **argv, int argc);
87+
88+int parse_keys(struct nl_msg *msg, char **argv[], int *argc);
89 int parse_freqchan(struct chandef *chandef, bool chan, int argc, char **argv, int *parsed);
90 enum nl80211_chan_width str_to_bw(const char *str);
91 int put_chandef(struct nl_msg *msg, struct chandef *chandef);
92diff --git a/util.c b/util.c
93index 6e0ddff..122c019 100644
94--- a/util.c
95+++ b/util.c
96@@ -417,23 +417,23 @@ static int parse_cipher_suite(const char *cipher_str)
97 return -EINVAL;
98 }
99
100-int parse_keys(struct nl_msg *msg, char **argv, int argc)
101+int parse_keys(struct nl_msg *msg, char **argv[], int *argc)
102 {
103 struct nlattr *keys;
104 int i = 0;
105 bool have_default = false;
106- char *arg = *argv;
107+ char *arg = **argv;
108 char keybuf[13];
109 int pos = 0;
110
111- if (!argc)
112+ if (!*argc)
113 return 1;
114
115 if (!memcmp(&arg[pos], "psk", 3)) {
116 char psk_keybuf[32];
117 int cipher_suite, akm_suite;
118
119- if (argc < 4)
120+ if (*argc < 4)
121 goto explain;
122
123 pos+=3;
124@@ -451,9 +451,9 @@ int parse_keys(struct nl_msg *msg, char **argv, int argc)
125 NLA_PUT(msg, NL80211_ATTR_PMK, 32, psk_keybuf);
126 NLA_PUT_U32(msg, NL80211_ATTR_AUTH_TYPE, NL80211_AUTHTYPE_OPEN_SYSTEM);
127
128- argv++;
129- argc--;
130- arg = *argv;
131+ *argv += 1;
132+ *argc -= 1;
133+ arg = **argv;
134
135 akm_suite = parse_akm_suite(arg);
136 if (akm_suite < 0)
137@@ -461,9 +461,9 @@ int parse_keys(struct nl_msg *msg, char **argv, int argc)
138
139 NLA_PUT_U32(msg, NL80211_ATTR_AKM_SUITES, akm_suite);
140
141- argv++;
142- argc--;
143- arg = *argv;
144+ *argv += 1;
145+ *argc -= 1;
146+ arg = **argv;
147
148 cipher_suite = parse_cipher_suite(arg);
149 if (cipher_suite < 0)
150@@ -471,9 +471,9 @@ int parse_keys(struct nl_msg *msg, char **argv, int argc)
151
152 NLA_PUT_U32(msg, NL80211_ATTR_CIPHER_SUITES_PAIRWISE, cipher_suite);
153
154- argv++;
155- argc--;
156- arg = *argv;
157+ *argv += 1;
158+ *argc -= 1;
159+ arg = **argv;
160
161 cipher_suite = parse_cipher_suite(arg);
162 if (cipher_suite < 0)
163@@ -495,7 +495,7 @@ int parse_keys(struct nl_msg *msg, char **argv, int argc)
164 struct nlattr *key = nla_nest_start(msg, ++i);
165 char *keydata;
166
167- arg = *argv;
168+ arg = **argv;
169 pos = 0;
170
171 if (!key)
172@@ -537,15 +537,15 @@ int parse_keys(struct nl_msg *msg, char **argv, int argc)
173
174 NLA_PUT(msg, NL80211_KEY_DATA, keylen, keydata);
175
176- argv++;
177- argc--;
178+ *argv += 1;
179+ *argc -= 1;
180
181 /* one key should be TX key */
182- if (!have_default && !argc)
183+ if (!have_default && !*argc)
184 NLA_PUT_FLAG(msg, NL80211_KEY_DEFAULT);
185
186 nla_nest_end(msg, key);
187- } while (argc);
188+ } while (*argc);
189
190 nla_nest_end(msg, keys);
191
192--
1932.17.1
194
diff --git a/meta/recipes-connectivity/iw/iw_4.14.bb b/meta/recipes-connectivity/iw/iw_4.14.bb
index e1b17de4c3..f414a4b1dc 100644
--- a/meta/recipes-connectivity/iw/iw_4.14.bb
+++ b/meta/recipes-connectivity/iw/iw_4.14.bb
@@ -12,6 +12,7 @@ DEPENDS = "libnl"
12SRC_URI = "http://www.kernel.org/pub/software/network/iw/${BP}.tar.gz \ 12SRC_URI = "http://www.kernel.org/pub/software/network/iw/${BP}.tar.gz \
13 file://0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch \ 13 file://0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch \
14 file://separate-objdir.patch \ 14 file://separate-objdir.patch \
15 file://0001-connect-fix-parsing-of-WEP-keys.patch \
15" 16"
16 17
17SRC_URI[md5sum] = "2067516ca9940fdb8c091ee3250da374" 18SRC_URI[md5sum] = "2067516ca9940fdb8c091ee3250da374"