summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-11-13 13:20:00 +0900
committerStephen Rothwell <sfr@canb.auug.org.au>2008-12-01 09:35:28 +1100
commit7231e5eede2b73f2de9790f3c7688445b32f9dab (patch)
treec6848a7eaf75258f7f07b8e21090b3e254d5189f /lib
parent940cc36f38f474dac06dd8f99e1da3f0e1f71bab (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,
/* keys passed in from the caller */
if (envp_ext) {
for (i = 0; envp_ext[i]; i++) {
- retval = add_uevent_var(env, envp_ext[i]);
+ retval = add_uevent_var(env, "%s", envp_ext[i]);
if (retval)
goto exit;
}