On Tue, May 24, 2022 at 5:32 AM Borislav Petkov <bp@xxxxxxxxx> wrote: > > finally a somewhat final version, lightly tested. I can't find anything wrong with this, but who knows what patch-blindness I have from looking at a few different versions of it. Maybe my eyes just skim over it now. I do note that the clearing of %rax here: > +.Lerms_exit: > + xorl %eax,%eax > + RET seems to be unnecessary, since %rax is never modified in the path leading to this. But maybe just as well just for consistency with the cases where it *is* used as a temporary. And I still suspect that "copy_to_user()" is *much* more interesting than "clear_user()", but I guess we can't inline it anyway due to all the other overhead (ie access_ok() and stac/clac). And for a plain "call memcpy/memset", we'd need compiler help to do this (at a minimum, we'd have to have the compiler use the 'rep movs/stos' register logic, and then we could patch things in place afterwards, with objtool creating the alternatives section or something). Linus