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

linux_*_hardened: use linux-hardened patch set #84522

Merged
merged 30 commits into from
Apr 19, 2020

Commits on Apr 17, 2020

  1. Configuration menu
    Copy the full SHA
    10dd3f3 View commit details
    Browse the repository at this point in the history
  2. linux: explicitly enable SYSVIPC

    The linux-hardened patch set removes this default, probably because of
    its original focus on Android kernel hardening.
    emilazy committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    3d01e80 View commit details
    Browse the repository at this point in the history
  3. linux_*_hardened: use linux-hardened patch set

    This is an updated version of the former upstream,
    https://github.com/AndroidHardeningArchive/linux-hardened, and provides
    a minimal set of additional hardening patches on top of upstream.
    
    The patch already incorporates many of our hardened profile defaults,
    and releases are timely (Linux 5.5.15 and 5.6.2 were released on
    2020-04-02; linux-hardened patches for them came out on 2020-04-03 and
    2020-04-04 respectively).
    emilazy committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    0d4f35e View commit details
    Browse the repository at this point in the history
  4. linux_*_hardened: don't set X86_X32

    As far as I can tell, this has never defaulted to on upstream, and our
    common kernel configuration doesn't turn it on, so the attack surface
    reduction here is somewhat homeopathic.
    emilazy committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    7d5352d View commit details
    Browse the repository at this point in the history
  5. linux_*_hardened: don't set VMAP_STACK

    This has been on by default upstream for as long as it's been an option.
    emilazy committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    3d4c8ae View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8efe83c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8c68055 View commit details
    Browse the repository at this point in the history
  8. linux_*_hardened: don't set RANDOMIZE_{BASE,MEMORY}

    These are on by default for x86 in upstream linux-5.6.2, and turned on
    for arm64 by anthraxx/linux-hardened@90f9670.
    emilazy committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    130f681 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    db6b327 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    33b94e5 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    303bb60 View commit details
    Browse the repository at this point in the history
  12. linux_*_hardened: don't set {,IO_}STRICT_DEVMEM

    STRICT_DEVMEM is on by default in upstream 5.6.2; IO_STRICT_DEVMEM is
    turned on by anthraxx/linux-hardened@103d23c.
    
    Note that anthraxx/linux-hardened@db1d27e
    disables DEVMEM by default, so this is only relevant if that default is
    overridden to turn it back on.
    emilazy committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    0611462 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    3eeb524 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    4fb796e View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    0d5f169 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    ed89b5b View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    7fdfe53 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    3b32cd2 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    cf1bce6 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    9da578a View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    71bbd87 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    af4f57b View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    46d12cc View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    cc28d51 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    84f258b View commit details
    Browse the repository at this point in the history
  26. nixos/hardened: enable user namespaces for root

    linux-hardened sets kernel.unprivileged_userns_clone=0 by default; see
    anthraxx/linux-hardened@104f440.
    
    This allows the Nix sandbox to function while reducing the attack
    surface posed by user namespaces, which allow unprivileged code to
    exercise lots of root-only code paths and have lead to privilege
    escalation vulnerabilities in the past.
    
    We can safely leave user namespaces on for privileged users, as root
    already has root privileges, but if you're not running builds on your
    machine and really want to minimize the kernel attack surface then you
    can set security.allowUserNamespaces to false.
    
    Note that Chrome's sandbox requires either unprivileged CLONE_NEWUSER or
    setuid, and Firefox's silently reduces the security level if it isn't
    allowed (see about:support), so desktop users may want to set:
    
        boot.kernel.sysctl."kernel.unprivileged_userns_clone" = true;
    emilazy committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    ad9bfe2 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    b0d5032 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    fe031d0 View commit details
    Browse the repository at this point in the history
  29. nixos/release-{small,combined}: add latestKernel.login

    Seems like a good idea to ensure that you can always use the latest
    stable upstream kernel.
    emilazy committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    e133e39 View commit details
    Browse the repository at this point in the history
  30. nixos/release-combined: add {,latestKernel.}hardened

    These now depend on an external patch set; add them to the release tests
    to ensure that the build doesn't break silently as new kernel updates
    are merged.
    emilazy committed Apr 17, 2020
    Configuration menu
    Copy the full SHA
    2e31fb4 View commit details
    Browse the repository at this point in the history