[arm/aarch64] Add comments warning that stack-protector initializer insns shouldn't be split
Following the publication of https://kb.cert.org/vuls/id/129209/ I've
been having a look at GCC's implementation for Arm and AArch64. I
haven't identified any issues yet, but it's a bit early to be
completely sure.
One observation, however, is that the instruction sequence that
initializes the stack canary might be vulnerable to producing a
reusable value if it were ever split early. I don't think we ever
would, because the memory locations involved with the stack protector
are all marked volatile to ensure that the values are only loaded at
the point in time when the test is intended to happen, and that also
has the effect of making it unlikely that the value would be reused
without reloading. Nevertheless, defence in depth is probably
warranted here.
So this patch just adds some comments warning that the patterns should
not be split.
* config/arm/arm.md (stack_protect_set_insn): Add security-related
comment.
* config/aarch64/aarch64.md (stack_protect_set_<mode>): Likewise.
From-SVN: r274946