summaryrefslogtreecommitdiff
path: root/meta/recipes-kernel/kmod
diff options
context:
space:
mode:
authorJames Minor <james.minor@ni.com>2017-01-25 18:13:32 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-31 14:40:18 +0000
commita54be23887cdc24a9b128be0913029fc8e63973d (patch)
tree98fa82d377306ed19e8540619e47dc7d1fb65450 /meta/recipes-kernel/kmod
parent62cc91e8831c72e9beceff13ad68dd69298135b5 (diff)
downloadopenembedded-core-a54be23887cdc24a9b128be0913029fc8e63973d.tar.gz
openembedded-core-a54be23887cdc24a9b128be0913029fc8e63973d.tar.bz2
openembedded-core-a54be23887cdc24a9b128be0913029fc8e63973d.zip
kmod: Fix handling of quotes in kernel command line
If a module parameter on the command line contains quotes, any spaces inside those quotes should be included as part of the parameter. Upstream-Status: Accepted Signed-off-by: James Minor <james.minor@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-kernel/kmod')
-rw-r--r--meta/recipes-kernel/kmod/kmod.inc1
-rw-r--r--meta/recipes-kernel/kmod/kmod/kcmdline_quotes.patch44
2 files changed, 45 insertions, 0 deletions
diff --git a/meta/recipes-kernel/kmod/kmod.inc b/meta/recipes-kernel/kmod/kmod.inc
index a59c30586e..cfa409dbb3 100644
--- a/meta/recipes-kernel/kmod/kmod.inc
+++ b/meta/recipes-kernel/kmod/kmod.inc
@@ -22,6 +22,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \
file://depmod-search.conf \
file://avoid_parallel_tests.patch \
file://fix-O_CLOEXEC.patch \
+ file://kcmdline_quotes.patch \
"
S = "${WORKDIR}/git"
diff --git a/meta/recipes-kernel/kmod/kmod/kcmdline_quotes.patch b/meta/recipes-kernel/kmod/kmod/kcmdline_quotes.patch
new file mode 100644
index 0000000000..46bdec59a7
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/kcmdline_quotes.patch
@@ -0,0 +1,44 @@
+From 4a6f92a10680e7e36807f5e2ae8e497e8d73a048 Mon Sep 17 00:00:00 2001
+From: James Minor <james.minor@ni.com>
+Date: Fri, 20 Jan 2017 17:15:50 -0600
+Subject: [PATCH] libkmod: Fix handling of quotes in kernel command line
+
+If a module parameter on the command line contains quotes, any
+spaces inside those quotes should be included as part of the
+parameter.
+
+Signed-off-by: James Minor <james.minor@ni.com>
+
+Upstream-Status: Accepted
+---
+ libkmod/libkmod-config.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
+index 57fbe37..ea40d19 100644
+--- a/libkmod/libkmod-config.c
++++ b/libkmod/libkmod-config.c
+@@ -497,6 +497,7 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
+ char buf[KCMD_LINE_SIZE];
+ int fd, err;
+ char *p, *modname, *param = NULL, *value = NULL, is_module = 1;
++ bool is_quoted = false;
+
+ fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC);
+ if (fd < 0) {
+@@ -514,6 +515,12 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
+ }
+
+ for (p = buf, modname = buf; *p != '\0' && *p != '\n'; p++) {
++ if (*p == '"') {
++ is_quoted = !is_quoted;
++ continue;
++ }
++ if (is_quoted)
++ continue;
+ switch (*p) {
+ case ' ':
+ *p = '\0';
+--
+1.9.1
+