Re: [RFC][PATCH] tracing/x86: Save CR2 before tracing irqsoff on error_entry

From: Linus Torvalds
Date: Thu Mar 21 2019 - 13:23:40 EST

On Thu, Mar 21, 2019 at 6:55 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> Looks to be an issue with the save_stack_trace_user() not checking if
> the address is canonical before reading it. I guess access_ok() doesn't
> check that.

access_ok() definitely does check for non-canonical.

But it only does so when USER_DS is in effect.

If you use KERNEL_DS, then you have to check the address yourself.