summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/esas2r
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-12-18 10:00:54 -0800
committerJames Bottomley <JBottomley@Parallels.com>2014-03-15 10:18:58 -0700
commitb9c2446695cf3f98aec32e3b3f942ad1514068d2 (patch)
treec3e0226012413451115f29f4043cdd79a7e0870c /drivers/scsi/esas2r
parent2e7063770ecf7d0d17a59eeb476107a4b608003a (diff)
downloadop-kernel-dev-b9c2446695cf3f98aec32e3b3f942ad1514068d2.zip
op-kernel-dev-b9c2446695cf3f98aec32e3b3f942ad1514068d2.tar.gz
[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')
-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 9bf285d..a82030a 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);
}
OpenPOWER on IntegriCloud