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

systemd-sysusers fails with "Failed to set up credentials: Invalid argument" on s390x #21511

Closed
DaanDeMeyer opened this issue Nov 25, 2021 · 3 comments

Comments

@DaanDeMeyer
Copy link
Contributor

DaanDeMeyer commented Nov 25, 2021

systemd version the issue has been seen with

main branch

Used distribution

Fedora

Linux kernel version used (uname -a)

5.14.18-300.fc35.x86_64

CPU architecture issue was seen on

s390x

Expected behaviour you didn't see

systemd-sysusers succeeds

Unexpected behaviour you saw

systemd-sysusers fails with "systemd-sysusers.service: Failed to set up credentials: Invalid argument"

Steps to reproduce the problem

Try to boot a s390x mkosi container

Additional program output to the terminal or log subsystem illustrating the issue

Failed to fork: Invalid argument
systemd-sysusers.service: Failed to set up credentials: Invalid argument

This happens using qemu user mode emulation. Can't say for sure it also happens on a real s390x machine. I confirmed it's clone() that fails with EINVAL when CLONE_NEWNS is set. If I remove CLONE_NEWNS the call to clone() succeeds.

@poettering
Copy link
Member

uh, user mode emulation in qemu is notoriously poor. They need to hook up every single syscall individually for each arch, and there are plenty of mistakes. I'd always assume it's a problem in qemu rather than our code unless proven otherwise...

@DaanDeMeyer
Copy link
Contributor Author

It seems so. I found https://github.com/qemu/qemu/blob/14d02cfbe4adaeebe7cb833a8cc71191352cf03b/linux-user/syscall.c#L188 which mentions they cannot support CLONE_NEWNS.

I do wish they'd gone for one of the operation not supported error codes in that case but let's close here as it's not systemd's problem.

@poettering
Copy link
Member

They should just add a fallback: if the flags combo looks like something that glibc doesn't support they should just call the syscall directly anyway, since apparently that's what the app did.

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

No branches or pull requests

2 participants