Re: [PATCH] x86/uaccess: restore get_user exception type to EX_TYPE_UACCESS

From: Youquan Song
Date: Fri Apr 01 2022 - 09:53:25 EST


On Thu, Mar 31, 2022 at 07:51:13PM +0200, Peter Zijlstra wrote:
> On Thu, Mar 31, 2022 at 07:31:25PM +0800, Youquan Song wrote:
> > > Did you do your testing on RHEL or something daft like that?
> > Tested on RHEL8.x
>
> Right; the home of obsolete software.. :-)
>
> > > Something like the below can also work, I suppose. But please, add
> > > coherent comments to the extable code with useful references to the MCE
> > > code that does this abuse.
> > Here is the full fix patch depending on your suggestion. Thanks a lot!
>
> Did you verify this was indeed the only UACCESS I lost?

The full fix patch has included a change in error_context to identify
this case to be MCE_IN_KERNEL_COPYIN. I verfied it fix the issue.
In addition, LTP was run and no issues were reported.

@@ -286,6 +286,7 @@ static noinstr int error_context(struct mce *m, struct pt_regs *regs)
switch (fixup_type) {
case EX_TYPE_UACCESS:
case EX_TYPE_COPY:
+ case EX_TYPE_UA_IMM_REG:
if (!copy_user)
return IN_KERNEL;
m->kflags |= MCE_IN_KERNEL_COPYIN;

-Youquan