Commit 4c8136d
committed
AES: Add function pointer trampoline to avoid delocator issue
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.
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 <beckphan@amazon.co.uk>1 parent 1cbed51 commit 4c8136d
1 file changed
Lines changed: 25 additions & 2 deletions
| 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 | + | |
57 | 80 | | |
58 | 81 | | |
59 | 82 | | |
| |||
65 | 88 | | |
66 | 89 | | |
67 | 90 | | |
68 | | - | |
| 91 | + | |
69 | 92 | | |
70 | 93 | | |
71 | | - | |
| 94 | + | |
72 | 95 | | |
73 | 96 | | |
74 | 97 | | |
| |||
0 commit comments