[PATCH] D152170: [ELF] Fix early overflow check in finalizeAddressDependentContent

Andreu Carminati via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 14:16:47 PDT 2023


andcarminati added a comment.

In D152170#4425336 <https://reviews.llvm.org/D152170#4425336>, @peter.smith wrote:

> In D152170#4425256 <https://reviews.llvm.org/D152170#4425256>, @kstoimenov wrote:
>
>> Looks like this or D151802 <https://reviews.llvm.org/D151802> broke the ubsan ARM bot: https://lab.llvm.org/buildbot/#/builders/238/builds/3938. Could you please revert or fix?
>>
>> Thanks!
>
> It would be this one. I suspect that it is the test rather than the code change:
>
>   REGION1__PADDED_SR_SIZE = MAX(1 << REGION1__PADDED_SR_SHIFT, 32);
>
> Where REGION1_PADDED_SR_SIZE isn't known till the second pass.
>
> I think in the short term the test could be modified to clamp REGION1__PADDED_SR_SHIFT to an in range value. More thought would need to be given to whether LLD can protect itself against out of range shifts coming from scripts. I expect this could get fixed within a day assuming the author or MaskRay is around, it is the end of the day here and I need to leave in 5 minutes so I'm not in a good place to take action myself.

Thank you for the analysis @peter.smith.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152170



More information about the llvm-commits mailing list