Skip to content

Commit

Permalink
[IA64] Keep format strings from leaking into printk
Browse files Browse the repository at this point in the history
The buffer being sent to printk has already had format strings
resolved. The string should not be reinterpreted again to avoid any
unintended format strings from leaking into printk.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Kees Cook authored and Tony Luck committed Mar 28, 2014
1 parent d211142 commit 4c332c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/ia64/kernel/mca.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void ia64_mca_printk(const char *fmt, ...)
/* Copy the output into mlogbuf */
if (oops_in_progress) {
/* mlogbuf was abandoned, use printk directly instead. */
printk(temp_buf);
printk("%s", temp_buf);
} else {
spin_lock(&mlogbuf_wlock);
for (p = temp_buf; *p; p++) {
Expand Down Expand Up @@ -268,7 +268,7 @@ void ia64_mlogbuf_dump(void)
}
*p = '\0';
if (temp_buf[0])
printk(temp_buf);
printk("%s", temp_buf);
mlogbuf_start = index;

mlogbuf_timestamp = 0;
Expand Down

0 comments on commit 4c332c3

Please sign in to comment.