Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants