Skip to content

Add an option to choose the name for the memfd#25

Open
notmarek wants to merge 3 commits into
MJx0:mainfrom
notmarek:main
Open

Add an option to choose the name for the memfd#25
notmarek wants to merge 3 commits into
MJx0:mainfrom
notmarek:main

Conversation

@notmarek
Copy link
Copy Markdown

@notmarek notmarek commented Mar 29, 2026

this should be useful to hide from apps that scan the maps file for unexpected memfd's by choosing something like jit-zygote-cache (this is useless with --hide)

@MJx0
Copy link
Copy Markdown
Owner

MJx0 commented Mar 30, 2026

Hi, thanks for contribution.

Since you added memfd_name to inject_elf_config_t struct then you can access it via _cfg.
you don't need to add a function parameter for it, you can simplify it by changing one line:

std::string memfd_rand = !_cfg.memfd_name.empty() ? _cfg.memfd_name : KittyUtils::String::random(KittyUtils::randInt(5, 12));

I haven't tested this but if memfd name like "jit-zygote-cache" already exists then there will be multiple entries so will findElf and findSoInfo return the correct one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants