replace_mm_exe_file(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… replace_mm_exe_file β€” Kernel API Manual ✨

okay so you found the replace_mm_exe_file page in the Kernel API Manual and you're like "bestie what is this" β€” don't worry, I got you 🫢 it's genuinely not that deep, it's literally one function that swaps out which file counts as a process's "executable" πŸ’–


✨ NAME ✨

replace_mm_exe_file β€” replace a reference to the mm's executable file πŸŽ€


🌸 SYNOPSIS 🌸

int replace_mm_exe_file (struct mm_struct *mm , struct file
*new_exe_file );

like, it takes two things and gives you back an int, that's the whole vibe 😌


πŸ¦‹ ARGUMENTS πŸ¦‹

  • mm β€” the mm you're changing. that's your main character right there πŸ‘‘
  • new_exe_file β€” the new file you wanna use. the glow-up file πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

so what it does: it changes mm's executable file β€” and yes, that's the one you see as the symlink at /proc/[pid]/exe 🧚 like, when you peek at that path, this is the thing you're peeking at, no cap ✨

the main user of this is sys_prctl(PR_SET_MM_MAP/EXE_FILE) β€” that's the one calling the shots πŸ”₯

ngl it's a small function but it's doing real work in there, respect it 🫑

🌈 SEE ALSO 🌈

sibling functions, the whole friend group πŸ’– all from the Kernel file ./kernel/fork.c:


aaaand that's the page πŸŽ€ source is ./kernel, version date October 2026, and the header was still screaming replace_mm_exe_file(9) at us the whole time because of course it was 😭 go read fork.c bestie, it's giving required reading πŸ’€β­

πŸ“¦ where this page comes from