Skip to content

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

Open
@romayalon

Description

@romayalon

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions