Skip to content

Commit

Permalink
s390/dis: Fix printing of the register numbers
Browse files Browse the repository at this point in the history
Since commit b006f19 ("lib/vsprintf.c: handle invalid format
specifiers more robustly") I get errors like
[...]
Krnl Code: 00000000004e2410: c00400000000        brcl 0,4e2410
Please remove unsupported %r in format string
[    8.179483] ------------[ cut here ]------------
[    8.179484] WARNING: at lib/vsprintf.c:1781

Turns out that our disassembler relied on %r not being used as format
string. Let's do the proper escaping of our decode buffers.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Christian Borntraeger authored and Martin Schwidefsky committed Nov 27, 2015
1 parent 155eeb6 commit 561e103
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/s390/kernel/dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,7 @@ void show_code(struct pt_regs *regs)
*ptr++ = '\t';
ptr += print_insn(ptr, code + start, addr);
start += opsize;
printk(buffer);
printk("%s", buffer);
ptr = buffer;
ptr += sprintf(ptr, "\n ");
hops++;
Expand All @@ -2042,7 +2042,7 @@ void print_fn_code(unsigned char *code, unsigned long len)
ptr += print_insn(ptr, code, (unsigned long) code);
*ptr++ = '\n';
*ptr++ = 0;
printk(buffer);
printk("%s", buffer);
code += opsize;
len -= opsize;
}
Expand Down

0 comments on commit 561e103

Please sign in to comment.