Beispiel #1
0
static void sanitise_execve(__unused__ int childno)
{
	/* we don't want to block if something tries to read from stdin */
	fclose(stdin);

	/* Fabricate argv */
	shm->syscall[childno].a2 = (unsigned long) gen_ptrs_to_crap();

	/* Fabricate envp */
	shm->syscall[childno].a3 = (unsigned long) gen_ptrs_to_crap();
}
Beispiel #2
0
static void sanitise_execve(struct syscallrecord *rec)
{
	unsigned long **argv, **envp;

	/* we don't want to block if something tries to read from stdin */
	fclose(stdin);

	/* Fabricate argv */
	argvcount = rand() % 32;
	argv = gen_ptrs_to_crap(argvcount);

	/* Fabricate envp */
	envpcount = rand() % 32;
	envp = gen_ptrs_to_crap(envpcount);

	if (this_syscallname("execve") == FALSE) {
		rec->a2 = (unsigned long) argv;
		rec->a3 = (unsigned long) envp;
	} else {
		rec->a3 = (unsigned long) argv;
		rec->a4 = (unsigned long) envp;
	}
}