Commit 3727d6e
powerpc64/bpf: use consistent tailcall offset in trampoline
Ideally, the offset used to load the tail call info field and to find
the pass by reference address for tail call field should be the same.
But while setting up the tail call info in the trampoline, this was
not followed. This can be misleading and can lead to unpredictable
results if and when bpf_has_stack_frame() ends up returning true
for trampoline frame. Since commit 15513be ("powerpc64/bpf:
Moving tail_call_cnt to bottom of frame") and commit 2ed2d8f
("powerpc64/bpf: Support tailcalls with subprogs") ensured tail call
field is at the bottom of the stack frame for BPF programs as well as
BPF trampoline, avoid relying on bpf_jit_stack_tailcallinfo_offset()
and bpf_has_stack_frame() for trampoline frame and always calculate
tail call field offset with reference to older frame.
Fixes: 2ed2d8f ("powerpc64/bpf: Support tailcalls with subprogs")
Signed-off-by: Hari Bathini <[email protected]>
Signed-off-by: Madhavan Srinivasan <[email protected]>
Link: https://patch.msgid.link/[email protected]1 parent 1578202 commit 3727d6e
3 files changed
Lines changed: 9 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | 84 | | |
88 | 85 | | |
89 | 86 | | |
| |||
219 | 216 | | |
220 | 217 | | |
221 | 218 | | |
222 | | - | |
223 | | - | |
224 | 219 | | |
225 | 220 | | |
226 | 221 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | 645 | | |
649 | 646 | | |
650 | 647 | | |
651 | 648 | | |
652 | 649 | | |
653 | | - | |
| 650 | + | |
| 651 | + | |
654 | 652 | | |
655 | 653 | | |
656 | 654 | | |
657 | 655 | | |
658 | 656 | | |
659 | 657 | | |
660 | 658 | | |
661 | | - | |
| 659 | + | |
662 | 660 | | |
663 | 661 | | |
664 | 662 | | |
665 | 663 | | |
666 | 664 | | |
667 | 665 | | |
668 | 666 | | |
669 | | - | |
| 667 | + | |
670 | 668 | | |
671 | 669 | | |
672 | 670 | | |
673 | 671 | | |
674 | 672 | | |
675 | 673 | | |
676 | | - | |
| 674 | + | |
677 | 675 | | |
678 | 676 | | |
679 | 677 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
151 | | - | |
| 154 | + | |
152 | 155 | | |
153 | 156 | | |
154 | 157 | | |
| |||
0 commit comments