summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2012-07-17 16:09:12 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-19 16:18:10 (GMT)
commit6ad86c19a926071571e9ab79fe4a51dac963d191 (patch)
tree7039101e2abdcfdb12d1eebc20fef857ab01ab4f /meta/recipes-connectivity
parent9d8387170ca37561ba1bedfa73b2b3eaf5f8c6bf (diff)
downloadpoky-6ad86c19a926071571e9ab79fe4a51dac963d191.tar.gz
connman: fix crashes on startup on PPC/MIPS
It appears that when there is no existing connman state there is memory corruption which causes free() on MIPS/PPC to abort. (From OE-Core rev: 4d79eb246d2d3aa9939882ae551db29b537a13df) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-connectivity')
-rw-r--r--meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch37
-rw-r--r--meta/recipes-connectivity/connman/connman_1.3.bb5
2 files changed, 40 insertions, 2 deletions
diff --git a/meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch b/meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch
new file mode 100644
index 0000000..c92b586
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch
@@ -0,0 +1,37 @@
1From ea8c7b3efce4c1762411e073893e948de5d552d6 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com>
3Date: Tue, 17 Jul 2012 16:04:12 +0100
4Subject: [PATCH] storage: check that the string isn't empty before splitting
5
6If the string was non-NULL but empty (str="\0"), the following \0 assignment
7would write to str[-1] and thus cause memory corruption.
8
9On PPC and MIPS, this was causing crashes in glibc.
10
11Signed-off-by: Ross Burton <ross.burton@intel.com>
12Upstream-Status: Submitted
13
14---
15 src/storage.c | 6 +++++-
16 1 file changed, 5 insertions(+), 1 deletion(-)
17
18diff --git a/src/storage.c b/src/storage.c
19index 47bd0cb..20766a3 100644
20--- a/src/storage.c
21+++ b/src/storage.c
22@@ -212,7 +212,11 @@ gchar **connman_storage_get_services()
23 closedir(dir);
24
25 str = g_string_free(result, FALSE);
26- if (str) {
27+ if (str && str[0] != '\0') {
28+ /*
29+ * Remove the trailing separator so that services doesn't end up
30+ * with an empty element.
31+ */
32 str[strlen(str) - 1] = '\0';
33 services = g_strsplit(str, "/", -1);
34 }
35--
361.7.10.4
37
diff --git a/meta/recipes-connectivity/connman/connman_1.3.bb b/meta/recipes-connectivity/connman/connman_1.3.bb
index a98b46c..4d82794 100644
--- a/meta/recipes-connectivity/connman/connman_1.3.bb
+++ b/meta/recipes-connectivity/connman/connman_1.3.bb
@@ -7,6 +7,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/network/connman/connman.git \
7 file://add_xuser_dbus_permission.patch \ 7 file://add_xuser_dbus_permission.patch \
8 file://connman \ 8 file://connman \
9 file://0002-storage.c-If-there-is-no-d_type-support-use-fstatat.patch \ 9 file://0002-storage.c-If-there-is-no-d_type-support-use-fstatat.patch \
10 file://0001-timezone.c-If-there-is-no-d_type-support-use-fstatat.patch" 10 file://0001-timezone.c-If-there-is-no-d_type-support-use-fstatat.patch \
11 file://0001-storage-check-that-the-string-isn-t-empty-before-spl.patch"
11S = "${WORKDIR}/git" 12S = "${WORKDIR}/git"
12PR = "${INC_PR}.1" 13PR = "${INC_PR}.2"