diff options
author | Robert Scott <code@humanleg.org.uk> | 2021-08-16 19:04:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-16 19:04:18 +0100 |
commit | 23485f23ff8536592b5178a5d244f84da770bc87 (patch) | |
tree | db495f1226471145411f497aa119c79483d3764a /nixos | |
parent | 6e01aa7ca639260aa4c8e652656f132fd5bfeb19 (diff) | |
parent | dca4f328194d8778b9b58adde2ab07e82d3fd596 (diff) |
Merge pull request #133556 from risicle/ris-graphene-hardened-malloc-8
graphene-hardened-malloc: 2 -> 8, overhaul tests
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/tests/hardened.nix | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/nixos/tests/hardened.nix b/nixos/tests/hardened.nix index 485efc0fb78c..a0b629086b5a 100644 --- a/nixos/tests/hardened.nix +++ b/nixos/tests/hardened.nix @@ -33,18 +33,7 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... } : { testScript = let - hardened-malloc-tests = pkgs.stdenv.mkDerivation { - name = "hardened-malloc-tests-${pkgs.graphene-hardened-malloc.version}"; - src = pkgs.graphene-hardened-malloc.src; - buildPhase = '' - cd test/simple-memory-corruption - make -j4 - ''; - - installPhase = '' - find . -type f -executable -exec install -Dt $out/bin '{}' + - ''; - }; + hardened-malloc-tests = pkgs.graphene-hardened-malloc.ld-preload-tests; in '' machine.wait_for_unit("multi-user.target") @@ -107,20 +96,7 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... } : { machine.fail("systemctl kexec") - # Test hardened memory allocator - def runMallocTestProg(prog_name, error_text): - text = "fatal allocator error: " + error_text - if not text in machine.fail( - "${hardened-malloc-tests}/bin/" - + prog_name - + " 2>&1" - ): - raise Exception("Hardened malloc does not work for {}".format(error_text)) - - with subtest("The hardened memory allocator works"): - runMallocTestProg("double_free_large", "invalid free") - runMallocTestProg("unaligned_free_small", "invalid unaligned free") - runMallocTestProg("write_after_free_small", "detected write after free") + machine.succeed("${hardened-malloc-tests}/bin/run-tests") ''; }) |