kernel hangs after running program that uses a custom SIGSEGV handler

Stef O'Rear sorear2 at
Wed Apr 11 17:14:52 PDT 2018

On Wed, Apr 11, 2018 at 6:10 PM, Bruno Haible <bruno at> wrote:
> Hi,
> $ uname
> Linux 4.16.0-rc2-00328-gebea62367bc4 #4 SMP Mon Feb 26 16:05:16 GMT 2018 riscv64 riscv64 riscv64 GNU/Linux
> This kernel either hangs or prints "BUG" messages when running a program that
> installs a SIGSEGV handler. That handler uses mprotect to change the access
> permissions of memory pages. It is known to work fine on all other Linux
> architectures that I tested.

The bug is caused by mishandling of PROT_NONE (failing to distinguish
between PROT_NONE and non-present pages), not by the segfault handler.
I sent a patch for this to Andrew and Richard a few weeks ago but
haven't had a chance to follow up.


More information about the linux-riscv mailing list