aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-11-12 23:20:00 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-06 13:44:31 -0500
commitc65b9145f40da99cad000f81823265dc70e5fcf9 (patch)
treef26091022846aea449821b6c1acdbc46d75da6b1 /lib
parentfce3e804cfad49208fd2ff9db4bcb57481409e1d (diff)
uevent: don't pass envp_ext[] as format string in kobject_uevent_env()
kobject_uevent_env() uses envp_ext[] as verbatim format string which can cause problems ranging from unexpectedly mangled string to oops if a string in envp_ext[] contains substring which can be interpreted as format. Fix it. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/kobject_uevent.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 3f914725bda8..ca215bc2329a 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -165,7 +165,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
165 /* keys passed in from the caller */ 165 /* keys passed in from the caller */
166 if (envp_ext) { 166 if (envp_ext) {
167 for (i = 0; envp_ext[i]; i++) { 167 for (i = 0; envp_ext[i]; i++) {
168 retval = add_uevent_var(env, envp_ext[i]); 168 retval = add_uevent_var(env, "%s", envp_ext[i]);
169 if (retval) 169 if (retval)
170 goto exit; 170 goto exit;
171 } 171 }