linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND][PATCH] scsi: esas2r: fix potential format string flaw
@ 2013-12-17 18:27 Kees Cook
  2013-12-17 20:00 ` Greg Kroah-Hartman
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kees Cook @ 2013-12-17 18:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Bradley Grove, James E.J. Bottomley, linux-scsi

This makes sure format strings cannot leak into the printk call via the
constructed buffer.

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/scsi/esas2r/esas2r_log.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/esas2r/esas2r_log.c b/drivers/scsi/esas2r/esas2r_log.c
index 9bf285df58dd..61fc19d296bd 100644
--- a/drivers/scsi/esas2r/esas2r_log.c
+++ b/drivers/scsi/esas2r/esas2r_log.c
@@ -171,7 +171,7 @@ static int esas2r_log_master(const long level,
 		if (strlen(event_buffer) < buflen)
 			strcat(buffer, "\n");
 
-		printk(event_buffer);
+		printk("%s", event_buffer);
 
 		spin_unlock_irqrestore(&event_buffer_lock, flags);
 	}
-- 
1.7.9.5


-- 
Kees Cook
Chrome OS Security

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

end of thread, other threads:[~2013-12-18 18:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-17 18:27 [RESEND][PATCH] scsi: esas2r: fix potential format string flaw Kees Cook
2013-12-17 20:00 ` Greg Kroah-Hartman
2013-12-17 21:17   ` Kees Cook
2013-12-17 21:54     ` Greg Kroah-Hartman
2013-12-17 21:45 ` Bradley Grove
2013-12-18  5:42 ` Joe Perches
2013-12-18 18:01   ` Kees Cook

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).