google / google/gvisor

Implement getsockopt(SO_PEERGROUPS)

Open
#14,202 0 comments 0 reactions 0 assignees View on GitHub
systemd type: enhancement
Dominant language
Go
Stars
19.3k
Forks
2k
Avg merge
3d 5h
Merged PRs (30d)
264

Description

### Description

`getsockopt(SOL_SOCKET, SO_PEERGROUPS)` is not
implemented for AF_UNIX sockets. Linux returns the peer's supplementary group
list as captured at connect()/socketpair() time.

dbus-broker (the system bus on RHEL 9/10, Fedora, Arch) uses this to evaluate
bus policy race-free. Under gVisor the getsockopt fails, so it degrades to
looking up the peer's groups via NSS and logs on every boot:

dbus-broker[38]: Falling back to racy auxiliary groups resolution using nss.

Functionally everything keeps working (the fallback succeeds), so this is a
congruence/robustness gap rather than a breakage: group changes after connect,
or groups not present in /etc/group, resolve differently than on Linux.

## Steps to reproduce

docker run -d --name ubi --runtime=runsc --privileged redhat/ubi10-init
docker exec ubi hostnamectl # any bus client, activates dbus-broker
docker exec ubi journalctl -u dbus-broker.service --no-pager

Observed: the "Falling back to racy auxiliary groups resolution" line.
Expected (runc): no such line; SO_PEERGROUPS returns the peer's groups.

### Is this feature related to a specific bug?

_No response_

### Do you have a specific solution in mind?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start at the getsockopt handling for AF_UNIX sockets and compare its behavior with Linux's SO_PEERGROUPS semantics. Reproduce with the provided runsc/docker commands and verify that getsockopt returns the peer's supplementary groups captured at connect()/socketpair() time, without the dbus-broker fallback.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
networking, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.