Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5459a4d8 authored by Christopher Ferris's avatar Christopher Ferris
Browse files

Refactor is_permissive_mte and remove allocs.

I accidentally modified is_permissive_mte to use a std::string
that allocates in a signal handler. Replace that call with a call
that reads the cmdline and doesn't do any allocations. Also,
refactor the code a bit to check values as you go instead of in
one big statement.

NOTE: This used to use /proc/XX/exe as the name of the executable,
      but this cl changes it to use the first argument in
      /proc/XX/cmdline so that this can distinguish zygote forked
      processes properly.

The MTE tests will fail when is_permissive_mte is enabled since it
causes MTE failures to be ignored.

Test: MTE test fails when environment variable MTE_PERMISSIVE is set to true.
Test: MTE test fails when property persist.sys.mte.permissive is set to true.
Test: MTE test fails when property persist.device_config.memory_safety_native.permissive.default is set to true.
Test: MTE test fails when property persist.device_config.memory_safety_native.permissive.process.debuggerd_test64 is set to true.
Test: Created a very long directory such that the command line name is truncated
Test: but the MTE tests still fails when using that truncated name.
Change-Id: Idf8f82a565e2cba8ec8af1b09d44f6ff5a3184da
parent 70fc1b79
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment