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

Skip ENOSYS filter in numa init #110082

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Skip ENOSYS filter in numa init #110082

merged 2 commits into from
Nov 22, 2024

Conversation

am11
Copy link
Member

@am11 am11 commented Nov 22, 2024

The usage of get_mempolicy is restricted by secomp profile in docker. I couldn't figure out way to repro it with SELinux (class labels are confusing), but docker approach is fine.

It was fixed in libnuma a few days ago numactl/numactl@0efea0e so it's not a huge issue.

Fix #110074

@am11 am11 requested a review from janvorli November 22, 2024 12:23
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 22, 2024
Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@janvorli
Copy link
Member

Actually, I am not sure if it is causing the crash in the #110074. The rest of the code in the function should still work and not crash. Since that crash happens on HarmonyOS, I wonder if the crash could occur in the syscall itself due to mishandling of the mode argument being NULL.

@am11 am11 changed the title Check for EPERM in numa init Skip ENOSYS filter in numa init Nov 22, 2024
@am11
Copy link
Member Author

am11 commented Nov 22, 2024

I was trying to repro it on Fedora VM with SELinux enabled, that operation not permitted is a bit tricky to reproduce since there is no class label for syscall (https://selinuxproject.org/page/ObjectClassesPerms#Kernel_Object_Classes) and my experiments were failing. With seccomp CAP_SYS_NICE, it's possible to make get_mempolicy syscall fail with EPERM. This change itself is aligning with the recent libnuma behavior. Also, from syscall(2) manpage:

ENOSYS The requested system call number is not implemented. Other errors are specific to the invoked system call.

@janvorli janvorli merged commit eed57c3 into dotnet:main Nov 22, 2024
90 checks passed
mikelle-rogers pushed a commit to mikelle-rogers/runtime that referenced this pull request Dec 10, 2024
* Check for EPERM in numa init

* Apply suggestions from code review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-GC-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C++ crashes when calling any function in nativeaot shared library
2 participants