Commit 5418ae31 authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman

staging: dgnc: fix potential format string flaw

Make sure that format strings cannot leak into printk() calls from the
msgbuf string.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9edf0f67
...@@ -454,7 +454,7 @@ static void dgnc_cleanup_board(struct board_t *brd) ...@@ -454,7 +454,7 @@ static void dgnc_cleanup_board(struct board_t *brd)
DGNC_LOCK(dgnc_global_lock, flags); DGNC_LOCK(dgnc_global_lock, flags);
brd->msgbuf = NULL; brd->msgbuf = NULL;
printk(brd->msgbuf_head); printk("%s", brd->msgbuf_head);
kfree(brd->msgbuf_head); kfree(brd->msgbuf_head);
brd->msgbuf_head = NULL; brd->msgbuf_head = NULL;
DGNC_UNLOCK(dgnc_global_lock, flags); DGNC_UNLOCK(dgnc_global_lock, flags);
...@@ -710,7 +710,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) ...@@ -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)); DPR_INIT(("dgnc_scan(%d) - printing out the msgbuf\n", i));
DGNC_LOCK(dgnc_global_lock, flags); DGNC_LOCK(dgnc_global_lock, flags);
brd->msgbuf = NULL; brd->msgbuf = NULL;
printk(brd->msgbuf_head); printk("%s", brd->msgbuf_head);
kfree(brd->msgbuf_head); kfree(brd->msgbuf_head);
brd->msgbuf_head = NULL; brd->msgbuf_head = NULL;
DGNC_UNLOCK(dgnc_global_lock, flags); DGNC_UNLOCK(dgnc_global_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment