Skip to content

Commit 69f5257

Browse files
btw616jmberg-intel
authored andcommitted
um: Prohibit the VM_CLONE flag in run_helper_thread()
Directly creating helper threads with VM_CLONE using clone can compromise the thread safety of errno. Since all these helper threads have been converted to use os_run_helper_thread(), let's prevent using this flag in run_helper_thread(). Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Link: https://patch.msgid.link/20250319135523.97050-5-tiwei.btw@antgroup.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent d295bee commit 69f5257

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/um/os-Linux/helper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ int run_helper_thread(int (*proc)(void *), void *arg, unsigned int flags,
122122
unsigned long stack, sp;
123123
int pid, status, err;
124124

125+
/* To share memory space, use os_run_helper_thread() instead. */
126+
if (flags & CLONE_VM)
127+
return -EINVAL;
128+
125129
stack = alloc_stack(0, __uml_cant_sleep());
126130
if (stack == 0)
127131
return -ENOMEM;

0 commit comments

Comments
 (0)