Loading src/client/intercept.cpp +22 −9 Changes for src/client/intercept.cpp: 22 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -1439,11 +1439,30 @@ internal_hook_guard_wrapper(long syscall_number, long arg0, long arg1, * being called inside a signal handler might easily forward a mock fd to the * kernel. */ static int passthrough_hook_wrapper(long syscall_number, long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long* syscall_return_value) { (void)syscall_number; (void)arg0; (void)arg1; (void)arg2; (void)arg3; (void)arg4; (void)arg5; (void)syscall_return_value; return gkfs::syscall::forward_to_kernel; } int hook_guard_wrapper(long syscall_number, long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long* syscall_return_value) { if(!CTX || !CTX->interception_enabled()) { return gkfs::syscall::forward_to_kernel; } pthread_once(&key_once_control, make_key); // Ensure the key is created if(pthread_getspecific(reentrance_guard_key) != NULL) { // While handling an application syscall, nested syscalls originate Loading @@ -1457,11 +1476,6 @@ hook_guard_wrapper(long syscall_number, long arg0, long arg1, long arg2, reentrance_guard_key, reinterpret_cast<void*>(1)); // cppcheck-suppress intToPointerCast if(!CTX->interception_enabled()) { pthread_setspecific(reentrance_guard_key, NULL); return gkfs::syscall::forward_to_kernel; } #ifdef SYS_socketcall if(syscall_number == SYS_socketcall) syscall_number = socketcall_wrapper(syscall_number, arg0, arg1, arg2, Loading Loading @@ -1506,12 +1520,11 @@ start_interception() { void stop_interception() { assert(CTX->interception_enabled()); LOG(DEBUG, "Disabling syscall interception for client process"); // Reset callback function pointer intercept_hook_point = nullptr; // Reset callback function pointer to passthrough so that subsequent syscalls // (during exit/shutdown/atexit) are forwarded to kernel instead of triggering SIGTRAP. intercept_hook_point = passthrough_hook_wrapper; intercept_hook_point_post_kernel = nullptr; intercept_hook_point_clone_child = nullptr; intercept_hook_point_clone_parent = nullptr; Loading Loading
src/client/intercept.cpp +22 −9 Changes for src/client/intercept.cpp: 22 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -1439,11 +1439,30 @@ internal_hook_guard_wrapper(long syscall_number, long arg0, long arg1, * being called inside a signal handler might easily forward a mock fd to the * kernel. */ static int passthrough_hook_wrapper(long syscall_number, long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long* syscall_return_value) { (void)syscall_number; (void)arg0; (void)arg1; (void)arg2; (void)arg3; (void)arg4; (void)arg5; (void)syscall_return_value; return gkfs::syscall::forward_to_kernel; } int hook_guard_wrapper(long syscall_number, long arg0, long arg1, long arg2, long arg3, long arg4, long arg5, long* syscall_return_value) { if(!CTX || !CTX->interception_enabled()) { return gkfs::syscall::forward_to_kernel; } pthread_once(&key_once_control, make_key); // Ensure the key is created if(pthread_getspecific(reentrance_guard_key) != NULL) { // While handling an application syscall, nested syscalls originate Loading @@ -1457,11 +1476,6 @@ hook_guard_wrapper(long syscall_number, long arg0, long arg1, long arg2, reentrance_guard_key, reinterpret_cast<void*>(1)); // cppcheck-suppress intToPointerCast if(!CTX->interception_enabled()) { pthread_setspecific(reentrance_guard_key, NULL); return gkfs::syscall::forward_to_kernel; } #ifdef SYS_socketcall if(syscall_number == SYS_socketcall) syscall_number = socketcall_wrapper(syscall_number, arg0, arg1, arg2, Loading Loading @@ -1506,12 +1520,11 @@ start_interception() { void stop_interception() { assert(CTX->interception_enabled()); LOG(DEBUG, "Disabling syscall interception for client process"); // Reset callback function pointer intercept_hook_point = nullptr; // Reset callback function pointer to passthrough so that subsequent syscalls // (during exit/shutdown/atexit) are forwarded to kernel instead of triggering SIGTRAP. intercept_hook_point = passthrough_hook_wrapper; intercept_hook_point_post_kernel = nullptr; intercept_hook_point_clone_child = nullptr; intercept_hook_point_clone_parent = nullptr; Loading