summaryrefslogtreecommitdiff
path: root/meta/packages/module-init-tools/files
diff options
context:
space:
mode:
authorKevin Tian <kevin.tian@intel.com>2010-08-06 16:37:47 +0800
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-06 18:33:15 +0100
commitf4cb0870acd980a35e6e87b5bcf548a4452fd6a7 (patch)
tree7168f1111fed02e9e2367bb2b84481fe6dfbd0c0 /meta/packages/module-init-tools/files
parent45d237b3bf7262d0a73098b04e8b162528ba99c0 (diff)
downloadopenembedded-core-f4cb0870acd980a35e6e87b5bcf548a4452fd6a7.tar.gz
openembedded-core-f4cb0870acd980a35e6e87b5bcf548a4452fd6a7.tar.bz2
openembedded-core-f4cb0870acd980a35e6e87b5bcf548a4452fd6a7.tar.xz
openembedded-core-f4cb0870acd980a35e6e87b5bcf548a4452fd6a7.zip
module-init-tools: fix depmod caused segfault issue
memset is required after malloc in grab_module, or else random segfault may happen. The fix is from Mark Hatle <mark.hatle@windriver.com>. Upstream bug is reported as: https://bugzilla.kernel.org/show_bug.cgi?id=16528 Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Diffstat (limited to 'meta/packages/module-init-tools/files')
-rw-r--r--meta/packages/module-init-tools/files/grab_module_memset.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/meta/packages/module-init-tools/files/grab_module_memset.patch b/meta/packages/module-init-tools/files/grab_module_memset.patch
new file mode 100644
index 000000000..955025531
--- /dev/null
+++ b/meta/packages/module-init-tools/files/grab_module_memset.patch
@@ -0,0 +1,19 @@
+# this patch is from Mark Hatle <mark.hatle@windriver.com>, who ran into
+# a random segfault using the latest module-init-tools (3.12) and finally
+# trace back to depmod.c:grab_module, which appears that the new malloc(...)
+# setups up things, but never clears the memory that was just allocated.
+#
+# Kevin Tian <kevin.tian@intel.com>, 2010-08-06
+
+diff --git a/depmod.c b/depmod.c
+index 647e5e6..46e03e0 100644
+--- a/depmod.c
++++ b/depmod.c
+@@ -313,6 +313,7 @@ static struct module *grab_module(const char *dirname, const char *filename)
+
+ new = NOFAIL(malloc(sizeof(*new)
+ + strlen(dirname?:"") + 1 + strlen(filename) + 1));
++ memset(new, 0x00, sizeof(*new) + strlen(dirname?:"") + 1 + strlen(filename) + 1);
+ if (dirname)
+ sprintf(new->pathname, "%s/%s", dirname, filename);
+ else