Skip to content

Don't fall back to file I/O on Linux when Rust only supports kernels guaranteed to have it #376

Closed

Description

@briansmith

According to https://doc.rust-lang.org/beta/rustc/platform-support.html, there are only a handful of target architectures where Rust supports kernels that are so old that they would not have the getrandom syscall. Notably riscv64gc and aarch64 are guaranteed to have getrandom according to the Rust kernel support policy. For those architectures we should not have enable the fallback logic at all. I suggest in particular that we have an allowlist of target architectures where we allow the fallback, which would be i686, x86_64, arm, armv7, powerpc, powerpc64, powerpc64le. s390x, i586, according to the Rust documents.

Activity

  1. josephlr commented on Oct 14, 2023

    @josephlr
    Member

    I like this idea, it also serves as a bit of a test run for removing such file-based support once rust increases its supported kernel version.

  2. newpavlov commented on Oct 16, 2023

    @newpavlov
    Member

    Sounds good to me!

  3. newpavlov commented on Feb 19, 2024

    @newpavlov
    Member

    What about Android targets?

    In this issue @josephlr wrote

    We need to have a /dev/urandom fallback and will need it at least until the 3.16 kernel ends LTS support in mid 2020.

    So we probably can disable file fallback for Android targets as per our platform support policy?

  4. briansmith commented on Feb 19, 2024

    @briansmith
    ContributorAuthor

    So we probably can disable file fallback for Android targets as per our platform support policy?

    I have been assuming getrandom's platform support is that of its MSRV, not the latest stable Rust version. We we need to go back and look at what the kernel support policy of Rust 1.36 was.

  5. workingjubilee commented on Mar 12, 2024

    @workingjubilee
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions