A process is created with vfork, whose child shares the parent's memory
What it finds
pid = vfork();: the child shares the parent's memory and stack until it calls execve or _exit, and anything else it does, returning from the function, calling exit, changing a variable, is undefined and corrupts the parent. POSIX removed vfork in 2008; fork or posix_spawn do the job safely.
From the rule's source, vfork_call.rs.
#include <unistd.h> int spawn(char **argv){ int pid = vfork();tx0 reports: the child of vfork runs in the parent's memory if (pid == 0) execv(argv[0], argv); return pid + fork();} Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/c:vfork-call" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/c:vfork-call] reason="..."tx0 explain tx0/c:vfork-call shows the same in the terminal. Found a false positive? Report it.