diff options
author | Kees Cook <keescook@chromium.org> | 2013-12-18 13:00:54 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2014-03-15 13:18:58 -0400 |
commit | b9c2446695cf3f98aec32e3b3f942ad1514068d2 (patch) | |
tree | c3e0226012413451115f29f4043cdd79a7e0870c /drivers/scsi/esas2r | |
parent | 2e7063770ecf7d0d17a59eeb476107a4b608003a (diff) |
[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.c | 8 |
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, | |||
165 | 165 | ||
166 | /* | 166 | /* |
167 | * Put a line break at the end of the formatted string so that | 167 | * Put a line break at the end of the formatted string so that |
168 | * we don't wind up with run-on messages. only append if there | 168 | * we don't wind up with run-on messages. |
169 | * is enough space in the buffer. | ||
170 | */ | 169 | */ |
171 | if (strlen(event_buffer) < buflen) | 170 | printk("%s\n", event_buffer); |
172 | strcat(buffer, "\n"); | ||
173 | |||
174 | printk(event_buffer); | ||
175 | 171 | ||
176 | spin_unlock_irqrestore(&event_buffer_lock, flags); | 172 | spin_unlock_irqrestore(&event_buffer_lock, flags); |
177 | } | 173 | } |