]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
charger-manager: Ensure event is not used as format string
authorKees Cook <keescook@chromium.org>
Thu, 6 Jun 2013 20:52:21 +0000 (13:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Jul 2013 18:39:17 +0000 (11:39 -0700)
commit 3594f4c0d7bc51e3a7e6d73c44e368ae079e42f3 upstream.

The exposed interface for cm_notify_event() could result in the event msg
string being parsed as a format string. Make sure it is only used as a
literal string.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/charger-manager.c

index 8acc3f8d303c70876e9e53e01a3dffa985cddc44..d31557fce14820b42a134798b0b72b145d1dd4e1 100644 (file)
@@ -450,7 +450,7 @@ static void uevent_notify(struct charger_manager *cm, const char *event)
        strncpy(env_str, event, UEVENT_BUF_SIZE);
        kobject_uevent(&cm->dev->kobj, KOBJ_CHANGE);
 
-       dev_info(cm->dev, event);
+       dev_info(cm->dev, "%s", event);
 }
 
 /**