[PATCH v2] powerpc: Fix __clear_user() with KUAP enabled

Michael Ellerman patch-notifications at ellerman.id.au
Wed Dec 18 15:05:10 AEDT 2019


On Mon, 2019-12-09 at 13:22:21 UTC, Andrew Donnellan wrote:
> The KUAP implementation adds calls in clear_user() to enable and disable
> access to userspace memory. However, it doesn't add these to
> __clear_user(), which is used in the ptrace regset code.
> 
> As there's only one direct user of __clear_user(), and the time taken to
> set the AMR for KUAP purposes is going to dominate the cost of a quick
> access_ok(), there's not much point having a separate path.
> 
> Rename __clear_user() to clear_user_asm(), and make __clear_user() just
> call clear_user().
> 
> Reported-by: syzbot+f25ecf4b2982d8c7a640 at syzkaller-ppc64.appspotmail.com
> Reported-by: Daniel Axtens <dja at axtens.net>
> Suggested-by: Michael Ellerman <mpe at ellerman.id.au>
> Cc: Christophe Leroy <christophe.leroy at c-s.fr>
> Cc: Russell Currey <ruscur at russell.cc>
> Fixes: de78a9c42a79 ("powerpc: Add a framework for Kernel Userspace Access Protection")
> Signed-off-by: Andrew Donnellan <ajd at linux.ibm.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/61e3acd8c693a14fc69b824cb5b08d02cb90a6e7

cheers


More information about the Linuxppc-dev mailing list