Commit d34220d9 authored by Ramon Nou's avatar Ramon Nou
Browse files

Merge branch 'marc/213-support-clone3-syscall-for-glibc-2-34' into 'master'

Resolve "Support clone3 syscall for <glibc-2.34"

Starting glibc-2.34, glibc uses the `clone3()` system call to create (instead of `clone()`). This breaks syscall_intercept causing a Segfault on the GekkoFS client. 

This MR only introduces a patch for syscall_intercept and no GekkoFS modifications. This patch will eventually part of our syscall_intercept fork.

Closes #213

See merge request !146
parents 8a2b71c9 eab9887e
Pipeline #2773 passed with stages
in 14 minutes and 18 seconds
......@@ -12,6 +12,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Removed
### Fixed
- Using `unlink` now fails if it is a directory unless the `AT_REMOVEDIR` flag is used (POSIX compliance) ([!139](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/139)).
- Support glibc-2.34 or newer with syscall_intercept [!146](https://storage.bsc.es/gitlab/hpc/gekkofs/-/merge_requests/146)).
## [0.9.1] - 2022-04-29
......
......@@ -269,7 +269,10 @@ clonedeps() {
# apply patch if provided
if [[ -n "${PATCH}" ]]; then
[[ "$DRY_RUN" == true ]] || (cd "${SOURCE_DIR}/${FOLDER}" && git apply --verbose "${PATCH_DIR}/${PATCH}" )
for PATCH_FILE in ${PATCH}; do
echo "Applying patch '${PATCH_DIR}/${PATCH_FILE}'..."
[[ "$DRY_RUN" == true ]] || (cd "${SOURCE_DIR}/${FOLDER}" && git apply --verbose "${PATCH_DIR}/${PATCH_FILE}" )
done
fi
}
......
diff --git a/src/intercept.c b/src/intercept.c
index 41fd95d..c0cd865 100644
--- a/src/intercept.c
+++ b/src/intercept.c
@@ -689,7 +689,8 @@ intercept_routine(struct context *context)
* the clone_child_intercept_routine instead, executing
* it on the new child threads stack, then returns to libc.
*/
- if (desc.nr == SYS_clone && desc.args[1] != 0)
+ if ((desc.nr == SYS_clone || desc.nr == SYS_clone3) &&
+ desc.args[1] != 0)
return (struct wrapper_ret){
.rax = context->rax, .rdx = 2 };
else
......@@ -60,7 +60,7 @@ clonedeps_args=(
# Patches that should be applied post-clone
clonedeps_patches=(
["syscall_intercept"]="syscall_intercept.patch"
["syscall_intercept"]="syscall_intercept.patch syscall_intercept_clone3.patch"
)
# Ordering that MUST be followed when downloading
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment