fbdev: omap2: remove potential format string leak
PATCH 1/1 fbdev: omap2: remove potential format string leak
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 <[email protected]>
--- drivers/video/fbdev/omap2/dss/display-sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/omap2/dss/display-sysfs.c +1 -1
@@ -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);
Signature · 6 lines
1.9.1 -- Kees Cook Chrome OS Security
Quoted 14 lines · Kees Cook
Since
kobject_init_and_addtakes a format string, make sure that the passed in name cannot be accidentally parsed.Signed-off-by Kees Cook <[email protected]>--- drivers/video/fbdev/omap2/dss/display-sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/video/fbdev/omap2/dss/display-sysfs.c +0
-0
drivers/video/fbdev/omap2/dss/display-sysfs.c int display_init_sysfs(struct platform_device *pdev) · line 330
Quoted 8 lines
drivers/video/fbdev/omap2/dss/display-sysfs.c +1
-1@@ -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);
Thanks, queued for 4.2.
Tomi