-
Notifications
You must be signed in to change notification settings - Fork 86
NSFS | FS Napi | getpwnam concurrency issue #8982
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
NSFS | FS Napi | getpwnam concurrency issue #8982
Conversation
728e86e
to
fb1433f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor comments
dc26aeb
to
fd102d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggested a minor change which is to allocate the memory in Work (which runs in worker thread) instead in ctor (which runs in main thread). Looks good.
Signed-off-by: Romy <[email protected]>
fd102d4
to
f225557
Compare
Describe the Problem
While debugging https://issues.redhat.com/browse/DFBUGS-2227, it was found that getpwnam() sometimes return incorrect uid/gid per the username provided.

After checking the getpwnam https://man7.org/linux/man-pages/man3/getpwnam.3.html man page, I saw that in fs_napi we use an unsafe multi threaded operation getpwnam() instead of the safe operation getpwnam_r().
Explain the Changes
Issues: Fixed #xxx / Gap #xxx
Testing Instructions:
you can use the following script -
If the bug reproduced you will see AccessDenied error and the following logs -
and especially important, you will see a log message saying getpwnam returned wrong uid/gid -
while in passwd file -