Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

segfault in mprotect #132

Open
donbowman opened this issue Aug 29, 2023 · 1 comment
Open

segfault in mprotect #132

donbowman opened this issue Aug 29, 2023 · 1 comment

Comments

@donbowman
Copy link

donbowman commented Aug 29, 2023

trying to mark mprotect as not avail.
ubuntu 22.04, x86-64.
below will segfault.

#include <libsyscall_intercept_hook_point.h>
#include <syscall.h>
#include <errno.h>

static int
hook(long syscall_number,
                        long arg0, long arg1,
                        long arg2, long arg3,
                        long arg4, long arg5,
                        long *result)
{
        if (syscall_number == SYS_mprotect) {
                *result = -ENOTSUP;
                return 0;
        } else {
                return 1;
        }
}

static __attribute__((constructor)) void
init(void)
{
        intercept_hook_point = hook;
}
@en4bz
Copy link
Collaborator

en4bz commented Sep 29, 2023

Can you share a backtrace if possible?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants