Skip to content

Supplemental groups thread safety issue + dynamic supplemental groups PANIC in a container #8985

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

Closed
romayalon opened this issue Apr 23, 2025 · 1 comment · Fixed by #9010
Closed
Assignees
Labels

Comments

@romayalon
Copy link
Contributor

romayalon commented Apr 23, 2025

Environment info

  • NooBaa Version: 4.19
  • Platform: NC in oowy container

Actual behavior

  1. We use getpwuid(uid) in our os_linux.cpp and os_darwin.cpp code while it's an unsafe for multi threaded usage per the getpwuid man page, while the thread safe function we should use is getpwuid_r().

The getpwuid() function need not be thread-safe.
...
The getpwuid_r() function is thread-safe and returns values in a
user-supplied buffer instead of possibly using a static data area
that may be overwritten by each call.

image
One more issue that might be related (or not) is the following -

4.19 -

Apr 22 13:28:37 node[1234]: PANIC: MUST SYSCALL FAILED: syscall(SYS_setgroups, groups.size(), &groups[0]) = -1 Operation not permitted (1) set_supplemental_groups() at ../src/native/util/os_linux.cpp:75

4.18.2 -

Apr 24 11:10:23 d93e136f730c node[442]: PANIC: MUST SYSCALL FAILED: syscall(SYS_setgroups, orig_groups.size(), &orig_groups[0]) = -1 Op
eration not permitted (1) restore_user() at ../src/native/util/os_linux.cpp:63
Apr 24 11:10:23 d93e136f730c node[442]: qemu: uncaught target signal 6 (Aborted) - core dumped

Expected behavior

  1. All napi functions in use should be thread safe and we should not fail on PANIC.

Steps to reproduce

  1. Run RHEL 9 container - docker run --privileged --user root -d --platform=linux/amd64 oowy/redhat:ubi9
  2. login to the container - docker exec -it <container_id> bash
  3. install NooBaa RPM per the instructions mentioned in https://github.com/noobaa/noobaa-core/blob/master/docs/NooBaaNonContainerized/GettingStarted.md#install
  4. Check NooBaa restarts in the logs - journalctl -u noobaa

More information - Screenshots / Logs / Other output

@romayalon
Copy link
Contributor Author

@nadavMiz probably it was closed automatically, Is the Panic fixed as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants