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 <michalis@unikraft.io>
Approved-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Andrei Tatar <andrei@unikraft.io>
GitHub-Closes: #1627
* 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;