Skip to contentSkip to conversation

scsi: esas2r: fix potential format string flaw

PATCH Superseded Kees Cook 2 participants 2 messages Sep 11, 2013

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 scsi: esas2r: fix potential format string flaw

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

---
 drivers/scsi/esas2r/esas2r_log.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/esas2r/esas2r_log.c +1 -1
index 9bf285d..61fc19d 100644
@@ -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);
 	}
Signature · 6 lines
1.7.9.5


-- 
Kees Cook
Chrome OS Security