HomePhabricator

[BPF] fix a use after free bug

Authored by yonghong-song on Nov 4 2019, 10:12 PM.

Description

[BPF] fix a use after free bug

Commit fff2721286e1 ("[BPF] Fix CO-RE bugs with bitfields")
fixed CO-RE handling bitfield issues. But the implementation
introduced a use after free bug. The "Base" of the intrinsic
might be freed so later on accessing the Type of "Base"
might access the freed memory. The failed test case,

CodeGen/BPF/CORE/offset-reloc-middle-chain.ll

is exactly used to test such a case.

Similarly to previous attempt to remember Metadata etc,
remember "Base" pointee Alignment in advance to avoid
such use after free bug.

Details

Committed
yonghong-songNov 4 2019, 10:20 PM
Parents
rGf65493a83e3b: [X86] Teach X86MCInstLower to swap operands of commutable instructions to…
Branches
Unknown
Tags
Unknown