Commit 6aaf00d1 authored by Tiwei Bie's avatar Tiwei Bie Committed by Johannes Berg
Browse files

um: Do not disable kmalloc in initial_thread_cb()



Currently, initial_thread_cb() temporarily disables kmalloc when
it invokes the callback, allowing the callback to bypass kmalloc.
This is unnecessary for the current users of initial_thread_cb(),
and we should avoid memory allocations that are not under the
control of the UML kernel. Therefore, let's stop temporarily
disabling kmalloc in initial_thread_cb().

Signed-off-by: default avatarTiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20251027001815.1666872-2-tiwei.bie@linux.dev


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent a7f7dbae
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -187,11 +187,7 @@ int copy_thread(struct task_struct * p, const struct kernel_clone_args *args)

void initial_thread_cb(void (*proc)(void *), void *arg)
{
	int save_kmalloc_ok = kmalloc_ok;

	kmalloc_ok = 0;
	initial_thread_cb_skas(proc, arg);
	kmalloc_ok = save_kmalloc_ok;
}

int arch_dup_task_struct(struct task_struct *dst,