Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20251027001815.1666872-2-tiwei.bie@linux.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Tiwei Bie and committed by
Johannes Berg
6aaf00d1 a7f7dbae

-4
-4
arch/um/kernel/process.c
··· 187 187 188 188 void initial_thread_cb(void (*proc)(void *), void *arg) 189 189 { 190 - int save_kmalloc_ok = kmalloc_ok; 191 - 192 - kmalloc_ok = 0; 193 190 initial_thread_cb_skas(proc, arg); 194 - kmalloc_ok = save_kmalloc_ok; 195 191 } 196 192 197 193 int arch_dup_task_struct(struct task_struct *dst,