Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting PR_SET_VMA_ANON_NAME is not supported even though Linux 5.17+ #129

Open
dlyongemallo opened this issue Feb 5, 2025 · 5 comments

Comments

@dlyongemallo
Copy link

OS (uname -r): 6.1.0-30-amd64

Running the following:

$ export MEMORY_PROFILER_LOG=warn
$ LD_PRELOAD=./libbytehound.so ./your_application

This results in the error: bytehound: 15ad0e 15ad0e WRN PR_SET_VMA_ANON_NAME is not supported (Linux 5.17+ required); will try to emulate in userspace

Note: bytebound was working on the same machine a few months ago. In the meantime, the kernel version was updated. I needed to run it again, and noticed it no longer works.

@dlyongemallo
Copy link
Author

I guess this may be the same issue as #127, except that the Linux version in my case actually meets the stated requirement.

@koute
Copy link
Owner

koute commented Feb 5, 2025

My guess is that your kernel has CONFIG_ANON_VMA_NAME config knob disabled, in which case you'd have to recompile it (or switch to a better Linux distribution).

@dlyongemallo
Copy link
Author

The error can be worked around by simply commenting out these lines:

        let is_supported = crate::syscall::pr_set_vma_anon_name( pointer, 4096, b"test\0" );
        crate::syscall::munmap( pointer, 4096 );

        if !is_supported {
            warn!( "PR_SET_VMA_ANON_NAME is not supported (Linux 5.17+ required); will try to emulate in userspace" );
            PR_SET_VMA_ANON_NAME_SUPPORTED = false;
        }

I'm not sure if there are any ill effects, but the program seems to work as before otherwise.

@dlyongemallo
Copy link
Author

My guess is that your kernel has CONFIG_ANON_VMA_NAME config knob disabled, in which case you'd have to recompile it (or switch to a better Linux distribution).

How can I tell if this config is enabled or not on my kernel?

Also, bytehound was working on the same machine a few months ago, and the only thing I've done is update the kernel using apt upgrade. Could that config have changed between kernel versions?

@koute
Copy link
Owner

koute commented Feb 5, 2025

How can I tell if this config is enabled or not on my kernel?

Often there's a config file in /boot, but in general this is distro-specific so you need to consult your distro docs.

Could that config have changed between kernel versions?

Yes, it's possible they disabled it (maybe because they thought no one needs it).

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

No branches or pull requests

2 participants