public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: dgnc: fix potential format string flaw
@ 2013-09-11  4:41 Kees Cook
  2013-09-11  5:00 ` Joe Perches
  0 siblings, 1 reply; 21+ messages in thread
From: Kees Cook @ 2013-09-11  4:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Lidza Louina, Tushar Behera, devel

Make sure that format strings cannot leak into printk() calls from the
msgbuf string.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/staging/dgnc/dgnc_driver.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index f8c1e22..71d2b83 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -454,7 +454,7 @@ static void dgnc_cleanup_board(struct board_t *brd)
 
 		DGNC_LOCK(dgnc_global_lock, flags);
 		brd->msgbuf = NULL;
-		printk(brd->msgbuf_head);
+		printk("%s", brd->msgbuf_head);
 		kfree(brd->msgbuf_head);
 		brd->msgbuf_head = NULL;
 		DGNC_UNLOCK(dgnc_global_lock, flags);
@@ -710,7 +710,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	DPR_INIT(("dgnc_scan(%d) - printing out the msgbuf\n", i));
 	DGNC_LOCK(dgnc_global_lock, flags);
 	brd->msgbuf = NULL;
-	printk(brd->msgbuf_head);
+	printk("%s", brd->msgbuf_head);
 	kfree(brd->msgbuf_head);
 	brd->msgbuf_head = NULL;
 	DGNC_UNLOCK(dgnc_global_lock, flags);
-- 
1.7.9.5


-- 
Kees Cook
Chrome OS Security

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

end of thread, other threads:[~2013-09-12 15:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-11  4:41 [PATCH] staging: dgnc: fix potential format string flaw Kees Cook
2013-09-11  5:00 ` Joe Perches
2013-09-11  5:19   ` Kees Cook
2013-09-11  9:31     ` Dan Carpenter
2013-09-11 18:19       ` Kees Cook
2013-09-11 19:09         ` Joe Perches
2013-09-11 19:25           ` Kees Cook
2013-09-11 19:45             ` Joe Perches
2013-09-11 19:47               ` Kees Cook
2013-09-11 23:22                 ` [RFC PATCH] vsnprintf: Remove use of %n and convert existing uses Joe Perches
2013-09-11 23:29                   ` Kees Cook
2013-09-11 23:43                     ` Joe Perches
2013-09-11 23:40                   ` Tetsuo Handa
2013-09-12  0:04                     ` Joe Perches
2013-09-12  0:19                       ` Al Viro
2013-09-12  0:41                         ` Joe Perches
2013-09-12  8:06                         ` David Laight
2013-09-12 15:59                           ` Joe Perches
2013-09-11 19:28           ` [PATCH] staging: dgnc: fix potential format string flaw Dan Carpenter
2013-09-11 19:22         ` Dan Carpenter
2013-09-11 19:26           ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox