diff options
author | Ross Burton <ross.burton@intel.com> | 2012-07-17 16:09:12 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-19 17:09:25 +0100 |
commit | 4d79eb246d2d3aa9939882ae551db29b537a13df (patch) | |
tree | 711fc28519d148ba19dd52553c6d0c21675e65cc /meta/recipes-connectivity | |
parent | 09203299c666791ce35d5a897fd1aa2b0d281dd6 (diff) | |
download | openembedded-core-4d79eb246d2d3aa9939882ae551db29b537a13df.tar.gz openembedded-core-4d79eb246d2d3aa9939882ae551db29b537a13df.tar.bz2 openembedded-core-4d79eb246d2d3aa9939882ae551db29b537a13df.zip |
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.
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.patch | 37 | ||||
-rw-r--r-- | meta/recipes-connectivity/connman/connman_1.3.bb | 5 |
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 0000000000..c92b58609c --- /dev/null +++ b/meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch @@ -0,0 +1,37 @@ +From ea8c7b3efce4c1762411e073893e948de5d552d6 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Tue, 17 Jul 2012 16:04:12 +0100 +Subject: [PATCH] storage: check that the string isn't empty before splitting + +If the string was non-NULL but empty (str="\0"), the following \0 assignment +would write to str[-1] and thus cause memory corruption. + +On PPC and MIPS, this was causing crashes in glibc. + +Signed-off-by: Ross Burton <ross.burton@intel.com> +Upstream-Status: Submitted + +--- + src/storage.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/storage.c b/src/storage.c +index 47bd0cb..20766a3 100644 +--- a/src/storage.c ++++ b/src/storage.c +@@ -212,7 +212,11 @@ gchar **connman_storage_get_services() + closedir(dir); + + str = g_string_free(result, FALSE); +- if (str) { ++ if (str && str[0] != '\0') { ++ /* ++ * Remove the trailing separator so that services doesn't end up ++ * with an empty element. ++ */ + str[strlen(str) - 1] = '\0'; + services = g_strsplit(str, "/", -1); + } +-- +1.7.10.4 + diff --git a/meta/recipes-connectivity/connman/connman_1.3.bb b/meta/recipes-connectivity/connman/connman_1.3.bb index a98b46ca1b..4d82794418 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 \ file://add_xuser_dbus_permission.patch \ file://connman \ file://0002-storage.c-If-there-is-no-d_type-support-use-fstatat.patch \ - file://0001-timezone.c-If-there-is-no-d_type-support-use-fstatat.patch" + file://0001-timezone.c-If-there-is-no-d_type-support-use-fstatat.patch \ + file://0001-storage-check-that-the-string-isn-t-empty-before-spl.patch" S = "${WORKDIR}/git" -PR = "${INC_PR}.1" +PR = "${INC_PR}.2" |