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

JitterEntropy Fails to Start via SystemD - ESXI 6.0 / Ubuntu 18.04 / 5.10.71-xanmod1 #24

Closed
weaselBuddha opened this issue Oct 12, 2021 · 10 comments

Comments

@weaselBuddha
Copy link

PID: 14726 (jitterentropy-r)
UID: 0 (root)
GID: 0 (root)
Signal: 31 (SYS)
Timestamp: Tue 2021-10-12 03:31:54 CEST (31min ago)
Command Line: /usr/local/sbin/jitterentropy-rngd
Executable: /usr/local/sbin/jitterentropy-rngd
Control Group: /system.slice/jitterentropy.service
Unit: jitterentropy.service
Slice: system.slice
Boot ID: 1ca270628e4940c7a35ebd0f29ac0c38
Machine ID: 7ae74b38bb314eb08357f142b6314be3
Hostname: rascal
Storage: /var/lib/systemd/coredump/core.jitterentropy-r.0.1ca270628e4940c7a35ebd0f29ac0c38.14726.1634002314000000.lz4
Message: Process 14726 (jitterentropy-r) of user 0 dumped core.

            Stack trace of thread 14726:
            #0  0x00007f5c968420a9 n/a (/lib/x86_64-linux-gnu/ld-2.27.so)
            #1  0x00007f5c96840df1 n/a (/lib/x86_64-linux-gnu/ld-2.27.so)
            #2  0x00007f5c96828128 n/a (/lib/x86_64-linux-gnu/ld-2.27.so)
            #3  0x00007f5c96827098 n/a (/lib/x86_64-linux-gnu/ld-2.27.so)

Status Entry:

● jitterentropy.service - Jitterentropy Gatherer Daemon
Loaded: loaded (/lib/systemd/system/jitterentropy.service; enabled; vendor pr
Active: failed (Result: signal) since Mon 2021-10-11 05:42:13 CEST; 12s ago
Process: 7972 ExecStart=/usr/local/sbin/jitterentropy-rngd (code=killed, signa
Main PID: 7972 (code=killed, signal=SYS)

Bad system call....

--

To fix had to comment out, from /lib/systemd/system/jitterentropy.service the lines:

#SystemCallFilter=@System-service
#SystemCallFilter=~@chown @clock @cpu-emulation @debug @ipc @module @mount @obsolete @PRIVILEGED @raw-io @reboot @resources @swap memfd_create mincore mlock mlockall personality

It will now start, no problem.

God I hate systemD

@smuellerDD
Copy link
Owner

smuellerDD commented Oct 12, 2021 via email

@weaselBuddha
Copy link
Author

weaselBuddha commented Oct 12, 2021

Isn't that what the systemd directives do? Limit what system calls that can be made (looks like the directives are being treated as e-mail addresses)

SystemCallFilter = @ system-service
SystemCallFilter=~ (list of calls)

If you comment out those two lines from the systemd service file, it starts fine

I had to systematically go thru to find them, because indeed, it started from the command line. Your systemd service file in my case (ESXi/Xanmod/18.04) was the culprit that was causing the failure.

ESXi creates part of this I suspect, there is no virtualized HWRNG device - hence the need for your package (entropy starvation is common)

It is working great for me now, just wanted to make an entry in case others have the same problem.

@smuellerDD
Copy link
Owner

smuellerDD commented Oct 24, 2021 via email

@weaselBuddha
Copy link
Author

Hope this is enough:

https://pastebin.com/kvGRk4Q7

@smuellerDD
Copy link
Owner

smuellerDD commented Nov 5, 2021 via email

@weaselBuddha
Copy link
Author

Stephan,

Jeez I hate systemd.

Failure only happens within the context of the systemd startup, so had to rig the strace there (and remember to do a systemctl reset-failed)

STrace Output: https://github.com/weaselBuddha/JitterFail

@smuellerDD
Copy link
Owner

smuellerDD commented Nov 8, 2021 via email

@weaselBuddha
Copy link
Author

Sorry about the version, I working across multiple servers. No difference with a new made pull.

I'm convinced that is a systemd affectation, it is killing jitter based on the system call limitations imposed by the SystemCallFilters defined in your systemd startup. Systemd is anything other than transparent.

I don't think there is a code problem in Jitter.

It runs fine from the command line.

It fails if called from the default systemd service file.

It runs fine if I comment out the SystemCallFilters directives in the systemd file.

The straces look identical, failed vs success, it just doesn't start up with the directives in place.

I'm glad to spin up a server for you so you can look hands-on if that helps - write me.

To us, with the directives disabled, it works great, thank you for the tool - vmware esxi doesn't give us a hardware or virtualized random device.

@smuellerDD
Copy link
Owner

smuellerDD commented Nov 8, 2021 via email

@weaselBuddha
Copy link
Author

weaselBuddha commented Nov 8, 2021

Sing the bonehead song, closing the issue. Failure of basic hygiene I guess.

Rerunning on a fresh server, new version of jitter, ran fine. The problem with the previous version (systemd sucks), will remain a mystery.

Fixing our server template to latest version.

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

No branches or pull requests

2 participants