From: Tejun Heo Date: Thu, 13 Nov 2008 04:20:00 +0000 (+0900) Subject: uevent: don't pass envp_ext[] as format string in kobject_uevent_env() X-Git-Tag: v2.6.29-rc1~229^2~53 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c65b9145f40da99cad000f81823265dc70e5fcf9;p=linux-2.6-omap-h63xx.git 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 Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 3f914725bda..ca215bc2329 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; }