Page MenuHomePhabricator

pcc (Peter Collingbourne)
User

Projects

User does not belong to any projects.

User Details

User Since
Dec 28 2012, 2:34 PM (351 w, 2 d)

Recent Activity

Aug 23 2019

pcc committed rGb2e7b8546825: hwasan: Align n_namesz and n_descsz to 4 when reading notes. (authored by pcc).
hwasan: Align n_namesz and n_descsz to 4 when reading notes.
Aug 23 2019, 4:37 PM
pcc committed rL369826: hwasan: Align n_namesz and n_descsz to 4 when reading notes..
hwasan: Align n_namesz and n_descsz to 4 when reading notes.
Aug 23 2019, 4:32 PM
pcc closed D66692: hwasan: Align n_namesz and n_descsz to 4 when reading notes..
Aug 23 2019, 4:32 PM · Restricted Project, Restricted Project
pcc created D66692: hwasan: Align n_namesz and n_descsz to 4 when reading notes..
Aug 23 2019, 4:24 PM · Restricted Project, Restricted Project
pcc committed rG5b31ac509687: hwasan: Fix use of uninitialized memory. (authored by pcc).
hwasan: Fix use of uninitialized memory.
Aug 23 2019, 2:38 PM
pcc committed rL369815: hwasan: Fix use of uninitialized memory..
hwasan: Fix use of uninitialized memory.
Aug 23 2019, 2:38 PM
pcc committed rGf7ca57468a6b: Move a break into the correct place. NFCI. (authored by pcc).
Move a break into the correct place. NFCI.
Aug 23 2019, 2:33 PM
pcc committed rL369813: Move a break into the correct place. NFCI..
Move a break into the correct place. NFCI.
Aug 23 2019, 2:32 PM
pcc added inline comments to D66426: [lld] Enable a watermark of loadable sections to be generated and placed in a note section.
Aug 23 2019, 12:38 PM · Restricted Project
pcc added a comment to D66658: [ELF] Align the first section of a PT_LOAD even if its type is SHT_NOBITS.

Thanks @MaskRay and @peter.smith for investigating this problem, I can confirm that this change fixes it for me.

Aug 23 2019, 10:01 AM · Restricted Project

Aug 22 2019

pcc added a comment to D64930: [ELF][AArch64] Allow PT_LOAD to have overlapping p_offset ranges.

Hi @MaskRay, it looks like this change has caused some binaries to start segfaulting on Android aarch64 devices. The strange thing is that the segfault happens even before entering the dynamic loader, and furthermore the segfault doesn't happen if I invoke the dynamic loader directly, so I'm guessing that the Linux kernel doesn't like the binary for some reason.


I've attached a repro.tar that I can use to reproduce this problem reliably like so (the "CANNOT LINK EXECUTABLE" error is expected because the runtime library is not present on the device):

$ ~/l2/ra/bin/ld.lld @response.txt
$ adb -s $pixel2 push bin /data/local/tmp
bin: 1 file pushed. 3.9 MB/s (15608 bytes in 0.004s)
$ adb -s $pixel2 shell
walleye:/ # /data/local/tmp/bin
Segmentation fault 
139|walleye:/ # /system/bin/linker64 /data/local/tmp/bin                                                                                   
CANNOT LINK EXECUTABLE "/data/local/tmp/bin": library "libclang_rt.hwasan-aarch64-android.so" not found

Without this change:

$ ~/l/ra/bin/ld.lld @response.txt
$ adb -s $pixel2 push bin /data/local/tmp
bin: 1 file pushed. 1.2 MB/s (17992 bytes in 0.014s)
$ adb -s $pixel2 shell
walleye:/ # /data/local/tmp/bin
CANNOT LINK EXECUTABLE "/data/local/tmp/bin": library "libclang_rt.hwasan-aarch64-android.so" not found

These instructions use Android adb, but given that the problem appears to be with the Linux kernel you might be able to reproduce on regular Linux as well.

Aug 22 2019, 7:38 PM · Restricted Project
pcc committed rG21a181441724: hwasan: Untag unwound stack frames by wrapping personality functions. (authored by pcc).
hwasan: Untag unwound stack frames by wrapping personality functions.
Aug 22 2019, 6:29 PM
pcc committed rL369721: hwasan: Untag unwound stack frames by wrapping personality functions..
hwasan: Untag unwound stack frames by wrapping personality functions.
Aug 22 2019, 6:29 PM
pcc closed D66377: hwasan: Untag unwound stack frames by wrapping personality functions..
Aug 22 2019, 6:29 PM · Restricted Project, Restricted Project
pcc updated the diff for D66377: hwasan: Untag unwound stack frames by wrapping personality functions..
  • Support aliases and other constants
Aug 22 2019, 5:43 PM · Restricted Project, Restricted Project
pcc added a comment to D66377: hwasan: Untag unwound stack frames by wrapping personality functions..

What's the binary size overhead? I assume most of it comes from adding personality functions to noexcept but !nounwind functions?

Aug 22 2019, 5:43 PM · Restricted Project, Restricted Project
pcc committed rL369697: IR. Change strip* family of functions to not look through aliases..
IR. Change strip* family of functions to not look through aliases.
Aug 22 2019, 1:00 PM
pcc committed rG2452d7030b84: IR. Change strip* family of functions to not look through aliases. (authored by pcc).
IR. Change strip* family of functions to not look through aliases.
Aug 22 2019, 1:00 PM
pcc closed D66606: IR. Change strip* family of functions to not look through aliases..
Aug 22 2019, 1:00 PM · Restricted Project, Restricted Project
pcc updated subscribers of D66606: IR. Change strip* family of functions to not look through aliases..
Aug 22 2019, 10:53 AM · Restricted Project, Restricted Project
pcc created D66606: IR. Change strip* family of functions to not look through aliases..
Aug 22 2019, 10:53 AM · Restricted Project, Restricted Project
pcc added a comment to D66437: Sema: Create a no-op implicit cast for lvalue function conversions..

Ping.

Aug 22 2019, 10:38 AM · Restricted Project
pcc added a comment to D66377: hwasan: Untag unwound stack frames by wrapping personality functions..

Ping.

Aug 22 2019, 10:35 AM · Restricted Project, Restricted Project

Aug 21 2019

pcc added inline comments to D66568: [GWP-ASan] Remove c++ standard lib dependency..
Aug 21 2019, 5:24 PM · Restricted Project, Restricted Project

Aug 20 2019

pcc accepted D66494: [GWP-ASan] Build stack_trace_compressor_fuzzer..

LGTM

Aug 20 2019, 6:19 PM · Restricted Project, Restricted Project
pcc added inline comments to D66494: [GWP-ASan] Build stack_trace_compressor_fuzzer..
Aug 20 2019, 6:19 PM · Restricted Project, Restricted Project
pcc added inline comments to D66494: [GWP-ASan] Build stack_trace_compressor_fuzzer..
Aug 20 2019, 5:43 PM · Restricted Project, Restricted Project

Aug 19 2019

pcc accepted D66264: [ThinLTO] Fix handling of weak interposable symbols.

This would also be fixed by switching to canonical aliases, right? Maybe another data point in favour of finally switching.

Aug 19 2019, 5:15 PM · Restricted Project
pcc added a comment to D63932: [GlobalDCE] Dead Virtual Function Elimination.

Partial linking will indeed prevent dropping the virtual functions, but it should not prevent clearing the pointer to the virtual function in the vtable. The linker should then be able to drop the virtual function body as part of --gc-sections during the final link.

If partial linking isn't doing internalisation, I'd expect that to prevent a lot of other LTO optimisations, not just VFE. Is this a common use-case which we need to care about?

Aug 19 2019, 4:50 PM · Restricted Project, Restricted Project
pcc created D66437: Sema: Create a no-op implicit cast for lvalue function conversions..
Aug 19 2019, 2:08 PM · Restricted Project
pcc committed rG4340c2cf8fa7: Build symbolizer runtime with C++14. (authored by pcc).
Build symbolizer runtime with C++14.
Aug 19 2019, 11:44 AM
pcc committed rL369290: Build symbolizer runtime with C++14..
Build symbolizer runtime with C++14.
Aug 19 2019, 11:43 AM

Aug 16 2019

pcc created D66377: hwasan: Untag unwound stack frames by wrapping personality functions..
Aug 16 2019, 6:19 PM · Restricted Project, Restricted Project
pcc added inline comments to D66355: [COFF] Add libcall symbols to the link when LTO is being used..
Aug 16 2019, 12:08 PM · Restricted Project
pcc added inline comments to D66355: [COFF] Add libcall symbols to the link when LTO is being used..
Aug 16 2019, 10:42 AM · Restricted Project

Aug 15 2019

pcc accepted D66167: MemTag: stack initializer merging..

LGTM

Aug 15 2019, 5:23 PM · Restricted Project
pcc added inline comments to D66167: MemTag: stack initializer merging..
Aug 15 2019, 4:31 PM · Restricted Project
pcc accepted D66312: Add missing MIR serialization text for AArch64II::MO_TAGGED..

LGTM

Aug 15 2019, 2:55 PM · Restricted Project

Aug 12 2019

pcc accepted D66090: gn build: Make sync script group output by revision.

LGTM

Aug 12 2019, 8:11 PM · Restricted Project
pcc accepted D66101: gn build: Give cmake sync script an opt-in --write flag.

LGTM

Aug 12 2019, 8:11 PM · Restricted Project
pcc added a comment to D65995: [ELF] Don't special case symbolic relocations with 0 addend to ifunc in writable locations.

HWASAN should only be using GOT relative relocations to access shadow memory, so I wouldn't expect this change to have an impact on HWASAN.

Aug 12 2019, 6:10 PM · Restricted Project

Aug 9 2019

pcc committed rG0e497d1554a9: cfi-icall: Allow the jump table to be optionally made non-canonical. (authored by pcc).
cfi-icall: Allow the jump table to be optionally made non-canonical.
Aug 9 2019, 3:32 PM
pcc committed rL368495: cfi-icall: Allow the jump table to be optionally made non-canonical..
cfi-icall: Allow the jump table to be optionally made non-canonical.
Aug 9 2019, 3:32 PM
pcc closed D65629: cfi-icall: Allow the jump table to be optionally made non-canonical..
Aug 9 2019, 3:32 PM · Restricted Project, Restricted Project
pcc updated the diff for D65629: cfi-icall: Allow the jump table to be optionally made non-canonical..
  • Address review comments
Aug 9 2019, 1:17 PM · Restricted Project, Restricted Project
pcc added inline comments to D65629: cfi-icall: Allow the jump table to be optionally made non-canonical..
Aug 9 2019, 1:17 PM · Restricted Project, Restricted Project
pcc committed rG41ac83de6ade: gn build: Merge r368432. (authored by pcc).
gn build: Merge r368432.
Aug 9 2019, 12:30 PM
pcc committed rG57e2d74729f2: gn build: Merge r368439. (authored by pcc).
gn build: Merge r368439.
Aug 9 2019, 12:29 PM
pcc committed rG66ad48e97d32: gn build: Merge r368402. (authored by pcc).
gn build: Merge r368402.
Aug 9 2019, 12:29 PM
pcc committed rG13dc20ddaed1: gn build: Merge r368392. (authored by pcc).
gn build: Merge r368392.
Aug 9 2019, 12:29 PM
pcc committed rG353aa77a5749: gn build: Merge r368358. (authored by pcc).
gn build: Merge r368358.
Aug 9 2019, 12:28 PM
pcc committed rL368470: gn build: Merge r368432..
gn build: Merge r368432.
Aug 9 2019, 12:28 PM
pcc committed rL368469: gn build: Merge r368439..
gn build: Merge r368439.
Aug 9 2019, 12:28 PM
pcc committed rL368468: gn build: Merge r368402..
gn build: Merge r368402.
Aug 9 2019, 12:28 PM
pcc committed rL368467: gn build: Merge r368392..
gn build: Merge r368392.
Aug 9 2019, 12:28 PM
pcc committed rL368466: gn build: Merge r368358..
gn build: Merge r368358.
Aug 9 2019, 12:27 PM
pcc added a reviewer for D65629: cfi-icall: Allow the jump table to be optionally made non-canonical.: eugenis.

Thanks for the confirmation Kees.

Aug 9 2019, 8:54 AM · Restricted Project, Restricted Project

Aug 8 2019

pcc committed rG1fa1cd200b9a: ELF: Move sections referred to by __start_/__stop_ symbols into the main… (authored by pcc).
ELF: Move sections referred to by __start_/__stop_ symbols into the main…
Aug 8 2019, 6:02 PM
pcc committed rL368375: ELF: Move sections referred to by __start_/__stop_ symbols into the main….
ELF: Move sections referred to by __start_/__stop_ symbols into the main…
Aug 8 2019, 5:57 PM
pcc closed D65909: ELF: Move sections referred to by __start_/__stop_ symbols into the main partition..
Aug 8 2019, 5:57 PM · Restricted Project
pcc committed rGbb17e46644bb: Linker: Add support for GlobalIFunc. (authored by pcc).
Linker: Add support for GlobalIFunc.
Aug 8 2019, 3:12 PM
pcc committed rL368357: Linker: Add support for GlobalIFunc..
Linker: Add support for GlobalIFunc.
Aug 8 2019, 3:11 PM
pcc closed D55046: Linker: Add support for GlobalIFunc..
Aug 8 2019, 3:11 PM · Restricted Project
pcc committed rG3a9059effb1c: hwasan: Add a code model check for tagged globals. (authored by pcc).
hwasan: Add a code model check for tagged globals.
Aug 8 2019, 2:40 PM
pcc committed rL368351: hwasan: Add a code model check for tagged globals..
hwasan: Add a code model check for tagged globals.
Aug 8 2019, 2:39 PM
pcc closed D65968: hwasan: Add a code model check for tagged globals..
Aug 8 2019, 2:39 PM · Restricted Project, Restricted Project
pcc added inline comments to D65909: ELF: Move sections referred to by __start_/__stop_ symbols into the main partition..
Aug 8 2019, 2:17 PM · Restricted Project
pcc updated the diff for D65909: ELF: Move sections referred to by __start_/__stop_ symbols into the main partition..
  • Switch to a symbol table lookup
  • Use --implicit-check-not
Aug 8 2019, 2:17 PM · Restricted Project
pcc created D65968: hwasan: Add a code model check for tagged globals..
Aug 8 2019, 1:18 PM · Restricted Project, Restricted Project
pcc committed rG01048033d20a: gn build: Merge r368331. (authored by pcc).
gn build: Merge r368331.
Aug 8 2019, 1:12 PM
pcc committed rL368333: gn build: Merge r368331..
gn build: Merge r368331.
Aug 8 2019, 1:11 PM
pcc added a comment to D65857: [MC][AArch64] Restrict use of signed relocation operators on MOV[NZK].
In D65857#1619366, @pcc wrote:

MHO: The assembler is a low enough level component that the user can be presumed to know what they're doing, regardless of linker limitations. So I would prefer not to do this. If we do anything about this, we should document the limitations of the GNU linkers somewhere.

It is a tricky balance, we don't want to rule out a reasonable use case, but ideally we want to detect problems as soon as possible. I think what I have here may be overly strict as if you happen to know that the result of a signed operation is positive then this can work, or if you happen to know you are linking with LLD.

One possible compromise is some kind of strict mode, something like --strict-movw-relocs that people could enable to restrict the relocations to a GNU compatible subset for those that need it. The command line option could also act as a kind of documentation that is a bit more visible. Any thoughts?

Aug 8 2019, 9:44 AM

Aug 7 2019

pcc added a comment to D65478: Create unique, but identically-named ELF sections for explicitly-sectioned functions and globals when using -function-sections and -data-sections..
In D65478#1620005, @pcc wrote:

Unfortunately, this causes some problems. It looks like the sections are created with different attributes than the original. This causes problems such as sections being writable when the original was read-only, including https://crbug.com/990942 where that causes program crashes. There is some more discussion on that bug report.

I'll revert this to unbreak the Chromium build, and we can come up with a way forward from there.

Hi Bob,
We plan to gate this feature behind a condition: D65837
I think in the Chromium case, what it needs is the -funique-section-names. More precisely, Chromium needs this flag only for the explicitly defined section "protected_memory", but I don't think it hurts to do it globally ( Chromium build may actually be using this flag anyways. Please confirm.)
If you think that the chromium build could use this flag, I will change D65837 to do the check.

Chromium is depending on an implementation detail here and the revert is temporary until we can land a compiler feature that will let us avoid the implementation detail dependence. It doesn't seem necessary to change the condition that you've already implemented in D65837.

Agreed.
However, I was thinking that the implementation detail relies on the assumption that only one section exists of the name "protected_memory" and if we somehow let the programmer specify that a particular section name can only appear once, it would resolve the problem. Enforcing the use of funique-section-names does look overkill.

Aug 7 2019, 3:51 PM · Restricted Project
pcc updated the diff for D65909: ELF: Move sections referred to by __start_/__stop_ symbols into the main partition..
  • Add test
Aug 7 2019, 3:29 PM · Restricted Project
pcc added a comment to D65478: Create unique, but identically-named ELF sections for explicitly-sectioned functions and globals when using -function-sections and -data-sections..

Unfortunately, this causes some problems. It looks like the sections are created with different attributes than the original. This causes problems such as sections being writable when the original was read-only, including https://crbug.com/990942 where that causes program crashes. There is some more discussion on that bug report.

I'll revert this to unbreak the Chromium build, and we can come up with a way forward from there.

Hi Bob,
We plan to gate this feature behind a condition: D65837
I think in the Chromium case, what it needs is the -funique-section-names. More precisely, Chromium needs this flag only for the explicitly defined section "protected_memory", but I don't think it hurts to do it globally ( Chromium build may actually be using this flag anyways. Please confirm.)
If you think that the chromium build could use this flag, I will change D65837 to do the check.

Aug 7 2019, 3:24 PM · Restricted Project
pcc created D65909: ELF: Move sections referred to by __start_/__stop_ symbols into the main partition..
Aug 7 2019, 3:21 PM · Restricted Project
pcc added inline comments to D65242: [ELF] More dynamic relocation packing.
Aug 7 2019, 1:48 PM · Restricted Project
pcc added a comment to D65857: [MC][AArch64] Restrict use of signed relocation operators on MOV[NZK].

MHO: The assembler is a low enough level component that the user can be presumed to know what they're doing, regardless of linker limitations. So I would prefer not to do this. If we do anything about this, we should document the limitations of the GNU linkers somewhere.

Aug 7 2019, 10:26 AM

Aug 6 2019

pcc committed rL368111: Require lld for hwasan tests..
Require lld for hwasan tests.
Aug 6 2019, 4:45 PM
pcc committed rGfeef101ac2f6: Require lld for hwasan tests. (authored by pcc).
Require lld for hwasan tests.
Aug 6 2019, 4:44 PM
pcc committed rG0930643ff6f1: hwasan: Instrument globals. (authored by pcc).
hwasan: Instrument globals.
Aug 6 2019, 3:08 PM
pcc committed rL368102: hwasan: Instrument globals..
hwasan: Instrument globals.
Aug 6 2019, 3:07 PM
pcc closed D65770: hwasan: Instrument globals..
Aug 6 2019, 3:07 PM · Restricted Project, Restricted Project, Restricted Project
pcc committed rG75e557c8e26d: gn build: Merge r368065. (authored by pcc).
gn build: Merge r368065.
Aug 6 2019, 2:51 PM
pcc committed rG0974e2257ae0: gn build: Merge r368052. (authored by pcc).
gn build: Merge r368052.
Aug 6 2019, 2:51 PM
pcc committed rGbd3d6677bcc8: gn build: Merge r368054. (authored by pcc).
gn build: Merge r368054.
Aug 6 2019, 2:51 PM
pcc committed rG9272a3c04fa1: gn build: Merge r368086. (authored by pcc).
gn build: Merge r368086.
Aug 6 2019, 2:51 PM
pcc committed rG7ae47137716a: gn build: Merge r368070. (authored by pcc).
gn build: Merge r368070.
Aug 6 2019, 2:50 PM
pcc committed rG411d96f99ad3: IR: Disable verifier check for GlobalValues with private linkage named after a… (authored by pcc).
IR: Disable verifier check for GlobalValues with private linkage named after a…
Aug 6 2019, 2:50 PM
pcc committed rL368099: gn build: Merge r368065..
gn build: Merge r368065.
Aug 6 2019, 2:50 PM
pcc committed rL368098: gn build: Merge r368052..
gn build: Merge r368052.
Aug 6 2019, 2:50 PM
pcc committed rL368096: gn build: Merge r368086..
gn build: Merge r368086.
Aug 6 2019, 2:46 PM
pcc committed rL368097: gn build: Merge r368054..
gn build: Merge r368054.
Aug 6 2019, 2:46 PM
pcc committed rL368095: gn build: Merge r368070..
gn build: Merge r368070.
Aug 6 2019, 2:46 PM
pcc committed rL368094: IR: Disable verifier check for GlobalValues with private linkage named after a….
IR: Disable verifier check for GlobalValues with private linkage named after a…
Aug 6 2019, 2:46 PM
pcc closed D65686: IR: Disable verifier check for GlobalValues with private linkage named after a comdat for non-COFF..
Aug 6 2019, 2:46 PM · Restricted Project
pcc added a comment to rL367501: Create unique, but identically-named ELF sections for explicitly-sectioned….

I'm not sure the second necessarily follows from the first. The way unique section names work for function-sections is to use a dot-separated suffix (".text._Z3foo", etc). Is the "strip the dot-separated suffix" standard, or some special case for .text? If it's standardized in some way, we could rely on that - adding a suffix to explicitly-named sections & the linker would remove those.

Yes, Unfortunately, section coalescing apparently only works with predefined sections (.text .data etc.).

@pcc had some thoughts on this too, his preference was more towards (2), so hopefully he'll chime in on my perspectives here so we can hash out the details.

I think It is really the use of unique section ids which makes the intended feature of this CL possible. So, if integrated-as=true entails that unique section ids are available, then we should condition on that.

Aug 6 2019, 2:21 PM
pcc updated subscribers of rL367501: Create unique, but identically-named ELF sections for explicitly-sectioned….
Aug 6 2019, 8:51 AM

Aug 5 2019

pcc committed rGf0380bac5f75: Silence ubsan after r367926. (authored by pcc).
Silence ubsan after r367926.
Aug 5 2019, 5:23 PM
pcc committed rL367959: Silence ubsan after r367926..
Silence ubsan after r367926.
Aug 5 2019, 5:23 PM