Exemplo n.º 1
0
void toggle_syscall_biarch(const char *arg, bool state)
{
	int specific_syscall32 = 0;
	int specific_syscall64 = 0;
	char *arg_name = NULL;
	bool only_32bit = TRUE;
	bool only_64bit = TRUE;

	check_user_specified_arch(arg, &arg_name, &only_64bit, &only_32bit);

	/* If we found a 64bit syscall, validate it. */
	specific_syscall64 = search_syscall_table(syscalls_64bit, max_nr_64bit_syscalls, arg_name);
	toggle_syscall_biarch_n(specific_syscall64, syscalls_64bit, only_64bit, do_64_arch, state, &activate_syscall64, 0, arg_name);

	/* Search for and validate 32bit */
	specific_syscall32 = search_syscall_table(syscalls_32bit, max_nr_32bit_syscalls, arg_name);
	toggle_syscall_biarch_n(specific_syscall32, syscalls_32bit, only_32bit, do_32_arch, state, &activate_syscall32, 0, arg_name);


	if ((!only_32bit) && (!only_64bit)) {
		outputerr("No idea what architecture for syscall (%s) is.\n", arg);
		exit(EXIT_FAILURE);
	}

	if ((specific_syscall64 == -1) && (specific_syscall32 == -1)) {
		outputerr("No idea what syscall (%s) is.\n", arg);
		exit(EXIT_FAILURE);
	}

	if ((specific_syscall64 != -1) && (specific_syscall32 != -1)) {
		output(0, "Marking syscall %s (64bit:%d 32bit:%d) as to be %sabled.\n",
			arg_name, specific_syscall64, specific_syscall32,
			state ? "en" : "dis");
		goto out;
	}

	if (specific_syscall64 != -1) {
		output(0, "Marking 64-bit syscall %s (%d) as to be %sabled.\n",
			arg, specific_syscall64,
			state ? "en" : "dis");
		goto out;
	}

	if  (specific_syscall32 != -1) {
		output(0, "Marking 32-bit syscall %s (%d) as to be %sabled.\n",
			arg, specific_syscall32,
			state ? "en" : "dis");
	}
out:
	clear_check_user_specified_arch(arg, &arg_name);
	return;

}
Exemplo n.º 2
0
void toggle_syscall(const char *arg, bool state)
{
	int specific_syscall = 0;
	char * arg_name = NULL;

	if (biarch == TRUE) {
		toggle_syscall_biarch(arg, state);
		return;
	}

	/* non-biarch case. */
	check_user_specified_arch(arg, &arg_name, NULL, NULL); //We do not care about arch here, just to get rid of arg flags.
	specific_syscall = search_syscall_table(syscalls, max_nr_syscalls, arg_name);
	toggle_syscall_n(specific_syscall, state, arg, arg_name);
	clear_check_user_specified_arch(arg, &arg_name);
}
Exemplo n.º 3
0
void toggle_syscall(const char *arg, bool state)
{
	int specific_syscall = 0;
	char * arg_name = NULL;

	if (biarch == TRUE) {
		toggle_syscall_biarch(arg, state);
		return;
	}

	/* non-biarch case. */
	check_user_specified_arch(arg, &arg_name, NULL, NULL); //We do not care about arch here, just to get rid of arg flags.

	specific_syscall = search_syscall_table(syscalls, max_nr_syscalls, arg_name);
	if (specific_syscall == -1) {
		outputerr("No idea what syscall (%s) is.\n", arg);
		goto out;
	}

	toggle_syscall_n(specific_syscall, state, arg, arg_name);

out:
	clear_check_user_specified_arch(arg, &arg_name);
}