[Lldb-commits] [PATCH] D98529: [lldb] Strip pointer authentication codes from aarch64 pc.

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 25 14:47:23 PDT 2021


jasonmolenda added a comment.

In D98529#2651468 <https://reviews.llvm.org/D98529#2651468>, @justincohen wrote:

> 



> Were you able to confirm if sysctlbyname "machdep.virtual_address_size" works on iOS? I'm currently hard coding this information in minidump creation, as it's failing for me.

Hey Justin, sorry I dropped this one.  I'll check later tonight or tomorrow.  Sometimes our internal devices are set up a little different than customer devices and things can work on the internal-configure one, so I need to play with it a bit.

>> I uploaded https://reviews.llvm.org/D98886 which reads a mask from a minidump and sets target.process.pointer-authentication-address-mask.  Would you consider that (as I assume this is going to be converted into a mask regardless, and I if there's a possibility for future non-contiguous bits)
>
> What do you think?

Clearing PAC bits is a little more complicated than just clearing the bits, though.  Bit 55 tells us whether the high bits are all 0's or all 1's (on Darwin, in EL0 processes they're all 0's, in EL1, all 1's).  If we had a setting to provide a mask instead of the number of bits that are valid in addressing, that might lead someone to try to use it for a different purpose.  Trying to imagine a scenario like this, maybe someone could know that a certain range of the address space isn't used for a certain type of pointer, and that they could reuse those bits as a Top Byte Ignore kind of thing, but the generated code would need to clear/set those bits before dereferencing, or we'd need a CPU with that kind of capability.  Maybe there could be examples of this today like the thumb bit on armv7, where the 0th bit on something with alignment restrictions can be used to carry metadata, although I can't think of anything like that on AArch/x86_64 (the only two targets I can really remember well these days).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98529/new/

https://reviews.llvm.org/D98529



More information about the lldb-commits mailing list