From: Michalis Pappas Date: Mon, 7 Apr 2025 09:10:22 +0000 (+0200) Subject: lib/posix-process: Ignore CLONE_VM when assigning tls parameter X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bcf8fd63d4f2586c2638c8dfee825a62f8de2602;p=unikraft%2Funikraft.git lib/posix-process: Ignore CLONE_VM when assigning tls parameter The interpretation of the tls parameter of clone() is conditional to passing CLONE_SETTLS in flags. Fix a bug where CLONE_VM would result into assigning the tls parameter to child. Assigning the parent's tls when CLONE_VFORK is set, is performed in clone_setup_child_ctx(), conditionally that the child's tls is not already set, presumably due to CLONE_SETTLS. Signed-off-by: Michalis Pappas Approved-by: Andrei Tatar Reviewed-by: Sergiu Moga Reviewed-by: Andrei Tatar GitHub-Closes: #1627 --- diff --git a/lib/posix-process/clone.c b/lib/posix-process/clone.c index 29138fef5..de9a5388f 100644 --- a/lib/posix-process/clone.c +++ b/lib/posix-process/clone.c @@ -512,7 +512,7 @@ int uk_clone(struct clone_args *cl_args, size_t cl_args_len, * NOTE: If SETTLS is not set, we do not activate any TLS * although a Unikraft TLS was allocated. */ - if ((flags & CLONE_SETTLS) || (flags & CLONE_VM)) + if ((flags & CLONE_SETTLS)) child->tlsp = tls; else child->tlsp = 0;