Re: [PATCH 4/9] x86/dumpstack: Improve opcodes dumping in the Code: section

From: Josh Poimboeuf
Date: Thu Mar 15 2018 - 14:23:08 EST


On Thu, Mar 15, 2018 at 04:44:43PM +0100, Borislav Petkov wrote:
> @@ -402,6 +396,10 @@ void show_regs(struct pt_regs *regs)
> */
> if (!user_mode(regs)) {
> show_trace_log_lvl(current, regs, NULL, KERN_DEFAULT);
> - show_opcodes((u8 *)regs->ip);
> +
> + if (regs->ip < PAGE_OFFSET)
> + pr_cont(" Bad RIP value.\n");
> + else
> + show_opcodes((u8 *)regs->ip);

[ Oops, sorry about three reviews for the same patch... ]

I don't see the printk preceding the pr_cont() here. Shouldn't it be
something like:

printk(KERN_DEFAULT "Code: Bad RIP value.\n")

?

--
Josh