This doesn't make the RNG cryptographic strength, but if we have it
easily accessible, why not include the pidfd id. It is after all not
vulnerable to reuse.
#include "missing_syscall.h"
#include "missing_threads.h"
#include "parse-util.h"
+#include "pidfd-util.h"
#include "process-util.h"
#include "random-util.h"
#include "sha256.h"
uint64_t call_id, block_id;
usec_t stamp_mono, stamp_real;
pid_t pid, tid;
+ uint64_t pidfdid;
uint8_t auxval[16];
} state = {
/* Arbitrary domain separation to prevent other usage of AT_RANDOM from clashing. */
memcpy(state.label, "systemd fallback random bytes v1", sizeof(state.label));
memcpy(state.auxval, ULONG_TO_PTR(getauxval(AT_RANDOM)), sizeof(state.auxval));
+ (void) pidfd_get_inode_id_self_cached(&state.pidfdid);
while (n > 0) {
struct sha256_ctx ctx;