Page MenuHomePhabricator

justincohen (Justin Cohen)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 12 2021, 9:39 AM (27 w, 3 d)

Recent Activity

Apr 16 2021

justincohen added a comment to D100515: [lldb] Add GetCodeAddressMask and GetDataAddressMask to Process.

Out of curiosity: Typically should one be able to set target.process.virtual-addressable-bits after the target has been created? Or is it expected that users will need to run in the following order only:

settings set target.process.virtual-addressable-bits ...
target create -c ....
Apr 16 2021, 11:21 AM · Restricted Project

Apr 15 2021

justincohen accepted D100515: [lldb] Add GetCodeAddressMask and GetDataAddressMask to Process.

On Darwin, we use the same number of bits for both code and data, but given the way ptrace() behaves on Linux, I'm guessing this may not be the case everywhere. Should we store both masks, and add FixCodeAddress + FixDataAddress methods in the ABI's, Justin? What do you think?

Apr 15 2021, 11:59 AM · Restricted Project

Apr 12 2021

justincohen added a comment to D99944: [LLDB] AArch64 Linux and elf-core PAC stack unwinder support.

Omair, Justin, what do you think here? I don't think it's especially hard to accept this in terms of # of bits OR a mask, and we should use the more general internal rep in lldb. Another alternative would be "the mask should be converted to the # of bits in addressing and stored in Process in those terms".

Apr 12 2021, 7:11 PM · Restricted Project

Apr 8 2021

justincohen added a reviewer for D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc.: labath.
Apr 8 2021, 8:28 AM · Restricted Project, Restricted Project

Mar 30 2021

justincohen added a reviewer for D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc.: omjavaid.
Mar 30 2021, 1:37 PM · Restricted Project, Restricted Project

Mar 29 2021

justincohen added a comment to D98529: [lldb] Strip pointer authentication codes from aarch64 pc..

Can we move comments over to --> https://reviews.llvm.org/D98886, which has these changes implemented?

Mar 29 2021, 9:26 AM · Restricted Project

Mar 26 2021

justincohen added inline comments to D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc..
Mar 26 2021, 12:18 PM · Restricted Project, Restricted Project
justincohen updated the diff for D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc..

Check CrashpadInfo version.

Mar 26 2021, 12:17 PM · Restricted Project, Restricted Project
justincohen updated the diff for D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc..

Inverted mask.

Mar 26 2021, 11:40 AM · Restricted Project, Restricted Project

Mar 25 2021

justincohen added a comment to D98529: [lldb] Strip pointer authentication codes from aarch64 pc..

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).

Mar 25 2021, 3:33 PM · Restricted Project
justincohen retitled D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc. from Past pointer authentication code mask from minidump and use to strip pac from pc. to Pass pointer authentication code mask from minidump and use to strip pac from pc..
Mar 25 2021, 1:09 PM · Restricted Project, Restricted Project
justincohen added a comment to D98529: [lldb] Strip pointer authentication codes from aarch64 pc..

OK we may need to retain the manual setting when I upstream this, instead of going with the pure Process-maintained value determined dynamically by gdb packet or corefile metadata. If this is something you need for your own FixCodeAddress prelim patch, I can upstream the target.process.virtual-addressable-bits setting (I think the name is fine, even once Process can determine this dynamically). We'll need to decide at some point what the correct behavior is when they conflict, but if only one is set the choice is straightforward.

Mar 25 2021, 12:34 PM · Restricted Project
justincohen retitled D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc. from Strip pointer authentication codes from MacOSX arc pc. to Past pointer authentication code mask from minidump and use to strip pac from pc..
Mar 25 2021, 12:27 PM · Restricted Project, Restricted Project

Mar 22 2021

justincohen updated the diff for D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc..

Fix length of crashpad structure / use ulittleXX

Mar 22 2021, 11:28 AM · Restricted Project, Restricted Project

Mar 18 2021

justincohen added reviewers for D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc.: markmentovai, jasonmolenda.
Mar 18 2021, 12:27 PM · Restricted Project, Restricted Project
justincohen updated the summary of D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc..
Mar 18 2021, 12:26 PM · Restricted Project, Restricted Project
justincohen requested review of D98886: Pass pointer authentication code mask from minidump and use to strip pac from pc..
Mar 18 2021, 12:24 PM · Restricted Project, Restricted Project

Mar 17 2021

justincohen added a comment to D98529: [lldb] Strip pointer authentication codes from aarch64 pc..
uint32_t addressing_bits;
size_t len = sizeof (uint32_t);
ret = sysctlbyname("machdep.virtual_address_size", &addressing_bits, &len, NULL, 0);
Mar 17 2021, 11:51 AM · Restricted Project
justincohen added a comment to D98529: [lldb] Strip pointer authentication codes from aarch64 pc..

In the meantime, I'll look into adding something to the Crashpad minidump format to store an addrable bits mask, although I'm not clear how to grab this in userspace. Should sysctl machdep.virtual_address_size work on iOS? Can I grab TCR_ELx.T0SZ directly?

Mar 17 2021, 8:29 AM · Restricted Project

Mar 16 2021

justincohen added a comment to D98529: [lldb] Strip pointer authentication codes from aarch64 pc..

Breakpad/Crashpad are not transporting mach-o core files, they are using minidumps. minidumps don't contain any indication of the number of bits in the address. Apple Xcode lldb is still able to work with these minidumps correctly, while trunk lldb is not. How is it able to do this even when the dump file doesn't contain “addrable bits” or equivalent?

Mar 16 2021, 4:36 PM · Restricted Project
justincohen added a comment to D98529: [lldb] Strip pointer authentication codes from aarch64 pc..

How does this work for a core dump?

Mar 16 2021, 1:44 PM · Restricted Project

Mar 15 2021

justincohen updated the diff for D98529: [lldb] Strip pointer authentication codes from aarch64 pc..

squash

Mar 15 2021, 8:12 AM · Restricted Project
justincohen added inline comments to D98529: [lldb] Strip pointer authentication codes from aarch64 pc..
Mar 15 2021, 8:09 AM · Restricted Project
justincohen updated the diff for D98529: [lldb] Strip pointer authentication codes from aarch64 pc..

Move logic to ABIMacOSX_arm64.h

Mar 15 2021, 8:05 AM · Restricted Project

Mar 12 2021

justincohen added a reviewer for D98529: [lldb] Strip pointer authentication codes from aarch64 pc.: jasonmolenda.
Mar 12 2021, 11:42 AM · Restricted Project
justincohen updated the diff for D98529: [lldb] Strip pointer authentication codes from aarch64 pc..

rebase

Mar 12 2021, 11:40 AM · Restricted Project
justincohen retitled D98529: [lldb] Strip pointer authentication codes from aarch64 pc. from Strip pointer authentication codes from aarch64 pc. to [lldb] Strip pointer authentication codes from aarch64 pc..
Mar 12 2021, 10:47 AM · Restricted Project
justincohen requested review of D98529: [lldb] Strip pointer authentication codes from aarch64 pc..
Mar 12 2021, 10:30 AM · Restricted Project