fbdev: omap2: remove potential format string leak
authorKees Cook <keescook@chromium.org>
Mon, 8 Jun 2015 22:30:53 +0000 (15:30 -0700)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 12 Jun 2015 09:37:45 +0000 (12:37 +0300)
Since kobject_init_and_add takes a format string, make sure that the
passed in name cannot be accidentally parsed.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/omap2/dss/display-sysfs.c

index 12186557a9d4d5030d23dd91453029a3d2cc8a3c..6ad0991f8259e16b3c2d2f2c3fdac9df43683a5a 100644 (file)
@@ -324,7 +324,7 @@ int display_init_sysfs(struct platform_device *pdev)
 
        for_each_dss_dev(dssdev) {
                r = kobject_init_and_add(&dssdev->kobj, &display_ktype,
-                       &pdev->dev.kobj, dssdev->alias);
+                       &pdev->dev.kobj, "%s", dssdev->alias);
                if (r) {
                        DSSERR("failed to create sysfs files\n");
                        omap_dss_put_device(dssdev);