summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/esas2r/esas2r_log.c
diff options
context:
space:
mode:
authorKees Cook2013-12-18 19:00:54 +0100
committerJames Bottomley2014-03-15 18:18:58 +0100
commitb9c2446695cf3f98aec32e3b3f942ad1514068d2 (patch)
treec3e0226012413451115f29f4043cdd79a7e0870c /drivers/scsi/esas2r/esas2r_log.c
parent[SCSI] lpfc: use NULL instead of 0 for pointer (diff)
downloadkernel-qcow2-linux-b9c2446695cf3f98aec32e3b3f942ad1514068d2.tar.gz
kernel-qcow2-linux-b9c2446695cf3f98aec32e3b3f942ad1514068d2.tar.xz
kernel-qcow2-linux-b9c2446695cf3f98aec32e3b3f942ad1514068d2.zip
[SCSI] esas2r: fix potential format string flaw
This makes sure format strings cannot leak into the printk call via the constructed buffer. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Bradley Grove <bgrove@attotech.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/esas2r/esas2r_log.c')
-rw-r--r--drivers/scsi/esas2r/esas2r_log.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/scsi/esas2r/esas2r_log.c b/drivers/scsi/esas2r/esas2r_log.c
index 9bf285df58dd..a82030aa8577 100644
--- a/drivers/scsi/esas2r/esas2r_log.c
+++ b/drivers/scsi/esas2r/esas2r_log.c
@@ -165,13 +165,9 @@ static int esas2r_log_master(const long level,
/*
* Put a line break at the end of the formatted string so that
- * we don't wind up with run-on messages. only append if there
- * is enough space in the buffer.
+ * we don't wind up with run-on messages.
*/
- if (strlen(event_buffer) < buflen)
- strcat(buffer, "\n");
-
- printk(event_buffer);
+ printk("%s\n", event_buffer);
spin_unlock_irqrestore(&event_buffer_lock, flags);
}