Skip to content

selectively intercept syscall for getrandom #301

@dkg

Description

@dkg

for historical reasons, many programs still invoke syscall() directly instead of using the glibc wrapper around getrandom (e.g. openssl does this).

If the build environment for faketime can guess at what such a syscall invocation would look like, maybe it could selectively intercept syscall itself. If FAKERANDOM_SEED is set, it could inspect the syscall number, and if it matches __NR_getrandom then invoke the internal getrandom instead. otherwise, it could forward the syscall through to real_syscall.

I don't know whether any of this makes sense for platforms other than GNU/Linux, so i might initially limit any attempts to that platform.

There is some weird variadic argument handling stuff that i'm not sure my C knowledge is deep enough handle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions