Assume a Linux binary foobar which has two different modes of operation:
- Mode A: A well-behaved mode in which syscalls
a,bandcare used. - Mode B: A things-gone-wrong mode in which syscalls
a,b,canddare used.
Syscalls a, b and c are harmless, whereas syscall d is potentially dangerous and could cause instability to the machine.
Assume further that which of the two modes the application runs is random: the application runs in mode A with probability 95 % and in mode B with probability 5 %. The application comes without source code so it cannot be modified, only run as-is.
I want to make sure that the application cannot execute syscall d. When executing syscall d the result should be either a NOOP or an immediate termination of the application.
How do I achieve that in a Linux environment?