summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-09-11 06:41:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-17 16:39:27 +0200
commit5418ae3188a9a57f318f51c3c26c0fedfea82f8b (patch)
treea9086ac41676733f1cefaa95d104323ef6d3bc14
parentstaging: lustre: clean up format string usages (diff)
downloadlinux-5418ae3188a9a57f318f51c3c26c0fedfea82f8b.tar.xz
linux-5418ae3188a9a57f318f51c3c26c0fedfea82f8b.zip
staging: dgnc: fix potential format string flaw
Make sure that format strings cannot leak into printk() calls from the msgbuf string. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/dgnc/dgnc_driver.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index f8c1e22585d6..71d2b83cc3a1 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);