Commit 156c75f
Alexei Starovoitov
Merge branch 'fix-ftrace-for-livepatch-bpf-fexit-programs'
Song Liu says:
====================
Fix ftrace for livepatch + BPF fexit programs
livepatch and BPF trampoline are two special users of ftrace. livepatch
uses ftrace with IPMODIFY flag and BPF trampoline uses ftrace direct
functions. When livepatch and BPF trampoline with fexit programs attach to
the same kernel function, BPF trampoline needs to call into the patched
version of the kernel function.
1/3 and 2/3 of this patchset fix two issues with livepatch + fexit cases,
one in the register_ftrace_direct path, the other in the
modify_ftrace_direct path.
3/3 adds selftests for both cases.
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
v4: https://patch.msgid.link/20251027175023.1521602-1-song@kernel.org
Changes v3 => v4:
1. Add helper reset_direct. (Steven)
2. Add Reviewed-by from Jiri.
3. Fix minor typo in comments.
v3: https://lore.kernel.org/bpf/20251026205445.1639632-1-song@kernel.org/
Changes v2 => v3:
1. Incorporate feedback by AI, which also fixes build error reported by
Steven and kernel test robot.
v2: https://lore.kernel.org/bpf/20251024182901.3247573-1-song@kernel.org/
Changes v1 => v2:
1. Target bpf tree. (Alexei)
2. Bring back the FTRACE_WARN_ON in __ftrace_hash_update_ipmodify
for valid code paths. (Steven)
3. Update selftests with cleaner way to find livepatch-sample.ko.
(offlline discussion with Ihor)
v1: https://lore.kernel.org/bpf/20251024071257.3956031-1-song@kernel.org/
====================
Signed-off-by: Alexei Starovoitov <ast@kernel.org>File tree
5 files changed
+185
-20
lines changed- kernel
- bpf
- trace
- tools/testing/selftests/bpf
- prog_tests
- progs
5 files changed
+185
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | 482 | | |
488 | 483 | | |
489 | 484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1971 | 1971 | | |
1972 | 1972 | | |
1973 | 1973 | | |
1974 | | - | |
| 1974 | + | |
| 1975 | + | |
1975 | 1976 | | |
1976 | 1977 | | |
1977 | 1978 | | |
| |||
2006 | 2007 | | |
2007 | 2008 | | |
2008 | 2009 | | |
2009 | | - | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
2010 | 2014 | | |
2011 | 2015 | | |
2012 | | - | |
| 2016 | + | |
2013 | 2017 | | |
2014 | 2018 | | |
2015 | 2019 | | |
| |||
2020 | 2024 | | |
2021 | 2025 | | |
2022 | 2026 | | |
2023 | | - | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
2024 | 2037 | | |
2025 | 2038 | | |
2026 | 2039 | | |
| |||
2076 | 2089 | | |
2077 | 2090 | | |
2078 | 2091 | | |
2079 | | - | |
| 2092 | + | |
2080 | 2093 | | |
2081 | 2094 | | |
2082 | 2095 | | |
| |||
2087 | 2100 | | |
2088 | 2101 | | |
2089 | 2102 | | |
2090 | | - | |
| 2103 | + | |
2091 | 2104 | | |
2092 | 2105 | | |
2093 | 2106 | | |
| |||
2101 | 2114 | | |
2102 | 2115 | | |
2103 | 2116 | | |
2104 | | - | |
| 2117 | + | |
2105 | 2118 | | |
2106 | 2119 | | |
2107 | 2120 | | |
| |||
5953 | 5966 | | |
5954 | 5967 | | |
5955 | 5968 | | |
| 5969 | + | |
| 5970 | + | |
| 5971 | + | |
| 5972 | + | |
| 5973 | + | |
| 5974 | + | |
| 5975 | + | |
| 5976 | + | |
| 5977 | + | |
| 5978 | + | |
| 5979 | + | |
5956 | 5980 | | |
5957 | 5981 | | |
5958 | 5982 | | |
| |||
6048 | 6072 | | |
6049 | 6073 | | |
6050 | 6074 | | |
| 6075 | + | |
| 6076 | + | |
6051 | 6077 | | |
6052 | 6078 | | |
6053 | 6079 | | |
| |||
6080 | 6106 | | |
6081 | 6107 | | |
6082 | 6108 | | |
6083 | | - | |
6084 | 6109 | | |
6085 | 6110 | | |
6086 | 6111 | | |
| |||
6090 | 6115 | | |
6091 | 6116 | | |
6092 | 6117 | | |
6093 | | - | |
| 6118 | + | |
6094 | 6119 | | |
6095 | 6120 | | |
6096 | | - | |
6097 | | - | |
6098 | | - | |
6099 | | - | |
6100 | 6121 | | |
6101 | 6122 | | |
6102 | 6123 | | |
| |||
6106 | 6127 | | |
6107 | 6128 | | |
6108 | 6129 | | |
6109 | | - | |
| 6130 | + | |
6110 | 6131 | | |
6111 | 6132 | | |
6112 | 6133 | | |
| |||
6126 | 6147 | | |
6127 | 6148 | | |
6128 | 6149 | | |
| 6150 | + | |
| 6151 | + | |
| 6152 | + | |
| 6153 | + | |
| 6154 | + | |
| 6155 | + | |
| 6156 | + | |
| 6157 | + | |
| 6158 | + | |
6129 | 6159 | | |
6130 | 6160 | | |
6131 | 6161 | | |
6132 | 6162 | | |
6133 | 6163 | | |
6134 | 6164 | | |
6135 | | - | |
6136 | 6165 | | |
6137 | 6166 | | |
6138 | 6167 | | |
| |||
6147 | 6176 | | |
6148 | 6177 | | |
6149 | 6178 | | |
| 6179 | + | |
6150 | 6180 | | |
6151 | 6181 | | |
6152 | 6182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| 115 | + | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
Lines changed: 107 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 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 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments