linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fbdev: omap2: remove potential format string leak
@ 2015-06-08 22:30 Kees Cook
  2015-06-12  9:38 ` Tomi Valkeinen
  0 siblings, 1 reply; 2+ messages in thread
From: Kees Cook @ 2015-06-08 22:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tomi Valkeinen, Jean-Christophe Plagniol-Villard, Kees Cook,
	linux-omap, linux-fbdev

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>
---
 drivers/video/fbdev/omap2/dss/display-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/omap2/dss/display-sysfs.c b/drivers/video/fbdev/omap2/dss/display-sysfs.c
index 12186557a9d4..6ad0991f8259 100644
--- a/drivers/video/fbdev/omap2/dss/display-sysfs.c
+++ b/drivers/video/fbdev/omap2/dss/display-sysfs.c
@@ -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);
-- 
1.9.1


-- 
Kees Cook
Chrome OS Security

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fbdev: omap2: remove potential format string leak
  2015-06-08 22:30 [PATCH] fbdev: omap2: remove potential format string leak Kees Cook
@ 2015-06-12  9:38 ` Tomi Valkeinen
  0 siblings, 0 replies; 2+ messages in thread
From: Tomi Valkeinen @ 2015-06-12  9:38 UTC (permalink / raw)
  To: Kees Cook, linux-kernel
  Cc: Jean-Christophe Plagniol-Villard, linux-omap, linux-fbdev

[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]



On 09/06/15 01:30, Kees Cook wrote:
> 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>
> ---
>  drivers/video/fbdev/omap2/dss/display-sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/omap2/dss/display-sysfs.c b/drivers/video/fbdev/omap2/dss/display-sysfs.c
> index 12186557a9d4..6ad0991f8259 100644
> --- a/drivers/video/fbdev/omap2/dss/display-sysfs.c
> +++ b/drivers/video/fbdev/omap2/dss/display-sysfs.c
> @@ -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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-12  9:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-08 22:30 [PATCH] fbdev: omap2: remove potential format string leak Kees Cook
2015-06-12  9:38 ` Tomi Valkeinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).