This makes sure a format string cannot accidentally leak into a device name.

Signed-off-by: Kees Cook <[email protected]>
---
 drivers/char/bsr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c
index 8fedbc250414..a6cef548e01e 100644
--- a/drivers/char/bsr.c
+++ b/drivers/char/bsr.c
@@ -259,7 +259,7 @@ static int bsr_add_node(struct device_node *bn)
                }
 
                cur->bsr_device = device_create(bsr_class, NULL, cur->bsr_dev,
-                                               cur, cur->bsr_name);
+                                               cur, "%s", cur->bsr_name);
                if (IS_ERR(cur->bsr_device)) {
                        printk(KERN_ERR "device_create failed for %s\n",
                               cur->bsr_name);
-- 
1.7.9.5


-- 
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to