Commit cce6b79
authored
AES: Add function pointer trampoline to avoid delocator issue (#2294)
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
--------
On AArch64, the delocator can patch up the computation of function
pointers only if the pointers can be computed with a PC-relative offset
in the range (-1MB, 1MB).
For the function pointer computations in aes/mode_wrappers.c, this
bounds condition is about to be violated by further code additions to
AWS-LC, as witnessed in AES-unrelated PRs (specifically #2176).
This commit preventatively fixes the issue by adding function pointer
trampolines to crypto/fipsmodule/aes/mode_wrappers.c: These are stub
functions immediately branching into the desired assembly routines, but
close enough to the C code computing their address to ensure that their
addresses will be computable using a PC-relative offset.
This fix is similar to #2165.
Mid/Long-term, it should be considered whether the delocator can
introduce the necessary indirections automatically.
Signed-off-by: Hanno Becker <[email protected]>1 parent a39439b commit cce6b79
1 file changed
+29
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
57 | 83 | | |
58 | 84 | | |
59 | 85 | | |
60 | 86 | | |
61 | 87 | | |
62 | | - | |
| 88 | + | |
63 | 89 | | |
64 | 90 | | |
65 | 91 | | |
66 | 92 | | |
67 | 93 | | |
68 | | - | |
| 94 | + | |
69 | 95 | | |
70 | 96 | | |
71 | | - | |
| 97 | + | |
72 | 98 | | |
73 | 99 | | |
74 | 100 | | |
| |||
0 commit comments