[PATCH] D41723: Introduce the "retpoline" x86 mitigation technique for variant #2 of the speculative execution vulnerabilities disclosed today, specifically identified by CVE-2017-5715, "Branch Target Injection", and is one of the two halves to Spectre..
Duncan P. N. Exon Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 15:33:12 PST 2018
dexonsmith added inline comments.
================
Comment at: llvm/lib/CodeGen/IndirectBrExpandPass.cpp:113
+ // index.
+ if (BBIndex == -1) {
+ BBIndex = BBs.size();
----------------
efriedma wrote:
> chandlerc wrote:
> > efriedma wrote:
> > > blockaddresses are uniqued, so no block should ever have more than one blockaddress user. So this should probably be an assertion.
> > I just didn't want to hard code that assumption, but I can if you prefer.
> If we violate that assumption, something has gone very wrong (either we've created a blockaddress in the wrong context, or we leaked a blockaddress from the context, or we have a blockaddress with an invalid block+function pair).
>
> Although, on a related note, you might want to check Constant::isConstantUsed(), so we don't generate indexes for blockaddresses which aren't actually referenced anywhere.
FWIW, I agree with Eli that it's fundamentally bad if constants haven't been uniqued properly.
https://reviews.llvm.org/D41723
More information about the llvm-commits
mailing list