cybersecurity · intermediate · ~15 min · safe pentest lab

Is the syscall on the allowlist?

Model an allowlist filter.

Challenge

Implement int syscall_allowed(const int *allow, int n, int nr) returning 1 if syscall number nr is in the allowlist array, else 0.

Starter code

int syscall_allowed(const int *allow, int n, int nr) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.