Commit 6a440bc
committed
feat!: default to
Leverage `sched/sched_process_exec` tracepoint to generate `execve`
exit events for both successful `execve` and `execveat` system calls.
For failing calls, use dedicated programs/fillers to generate `execve`
and `execveat` exit events.
This architectural choice is motivated by the fact that the kernel
haven't consistently called the correct tracepoint for `execve` and
`execveat` calls on all architectures, as well as haven't consistently
identified the correct system call in the tracepoint context:
- on `x86_64`, a successful `execveat` call is identified as `execve`,
and a failing one is identified as `execveat`
- on `aarch64`, till version 5.18 (actually, the fix was back-ported
up to 5.15:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.15.y&id=42eede3ae05bbf32cb0d87940b466ec5a76aca3f),
neither successful `execve`s nor successful `execveat`s used to
trigger the `sys_exit` (see
https://www.spinics.net/lists/linux-trace/msg01001.html) tracepoint;
only failing ones have always triggered the correct behaviour
- on `s390x`, each call correctly triggers `sys_exit` tracepoint and
is correctly identified as `execve` and `execveat`
Indeed, the `sched/sched_process_exec` is correctly triggered on all
architectures for successful calls. Moreover, failing calls correctly
trigger the `sys_exit` tracepoint, and are correctly associated to the
right syscall number.
In the past, this design was applied just for `aarch64`, but since it
works consistently on all architectures, its application was extended.
The only issue seems to be that now we generate `execve` exit events
for both `execve` and `execveat`, on call success: this is not a big
problem because, in the previous implementation, for successful
`execveat` calls, we were only able to generate `execveat` exit event
on `s390x`. For this latter case, users will not be impacted by the
new design if they rely on rule conditions matching both `execve` and
`execveat` event (e.g.: `... evt.type in (execve, execveat) ...`).
This patch rearranges `execve` and `execveat` driver tests, by moving
tests related to successful calls in
`test/drivers/test_suites/generic_tracepoints_suite/sched_process_exec.cpp`,
and keeping tests related to failing calls in
`test/drivers/test_suites/syscall_exit_suite/execve_x.cpp` and
`test/drivers/test_suites/syscall_exit_suite/execveat_x.cpp`.
Old tests relate to new tests in the following way:
- `execveX_success` -> `sched_proc_exec_execve`
- `execveX_not_upperlayer` -> `sched_proc_exec_execve_not_upperlayer`
- `execveX_upperlayer_success` -> `sched_proc_exec_execve_upperlayer`
- `execveX_success_memfd` -> `sched_proc_exec_execve_memfd`
- `execveX_symlink` -> `sched_proc_exec_execve_symlink`
- `execveatX_correct_exit` -> `sched_proc_exec_execveat`
- `execveatX_execve_exit` -> `sched_proc_exec_execveat`
- `execveatX_execve_exit_comm_equal_to_fd` -> `sched_proc_exec_execveat_comm_equal_to_fd`
- `execveatX_success_memfd` -> `sched_proc_exec_execveat_memfd`
BREAKING CHANGE: emit `execve` exit event instead of `execveat` exit
event in case of successful `execveat` call on `s390x`
Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>sched_process_exec tracepoint on all architectures1 parent e231639 commit 6a440bc
File tree
16 files changed
+1009
-1382
lines changed- driver
- bpf
- modern_bpf/programs
- attached/events
- tail_called/events/syscall_dispatched_events
- test/drivers/test_suites
- generic_tracepoints_suite
- syscall_exit_suite
- userspace/libpman/src
16 files changed
+1009
-1382
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
222 | 225 | | |
223 | 226 | | |
224 | 227 | | |
| |||
2267 | 2270 | | |
2268 | 2271 | | |
2269 | 2272 | | |
| 2273 | + | |
| 2274 | + | |
2270 | 2275 | | |
2271 | | - | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
2272 | 2281 | | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
2273 | 2287 | | |
2274 | | - | |
2275 | 2288 | | |
2276 | 2289 | | |
2277 | 2290 | | |
| |||
6715 | 6728 | | |
6716 | 6729 | | |
6717 | 6730 | | |
6718 | | - | |
6719 | 6731 | | |
6720 | 6732 | | |
6721 | 6733 | | |
| |||
7111 | 7123 | | |
7112 | 7124 | | |
7113 | 7125 | | |
7114 | | - | |
7115 | | - | |
7116 | 7126 | | |
7117 | 7127 | | |
7118 | 7128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
552 | 551 | | |
553 | 552 | | |
554 | 553 | | |
| |||
569 | 568 | | |
570 | 569 | | |
571 | 570 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | 571 | | |
577 | 572 | | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
578 | 576 | | |
579 | | - | |
580 | 577 | | |
581 | | - | |
582 | 578 | | |
583 | 579 | | |
584 | 580 | | |
585 | 581 | | |
586 | 582 | | |
587 | 583 | | |
588 | | - | |
589 | 584 | | |
590 | 585 | | |
591 | 586 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
211 | 210 | | |
212 | 211 | | |
213 | | - | |
214 | 212 | | |
215 | 213 | | |
216 | 214 | | |
| |||
289 | 287 | | |
290 | 288 | | |
291 | 289 | | |
292 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
293 | 314 | | |
294 | 315 | | |
295 | 316 | | |
| |||
324 | 345 | | |
325 | 346 | | |
326 | 347 | | |
327 | | - | |
328 | 348 | | |
329 | 349 | | |
330 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
| |||
163 | 161 | | |
164 | 162 | | |
165 | 163 | | |
166 | | - | |
167 | | - | |
168 | 164 | | |
169 | 165 | | |
170 | 166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 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 | 68 | | |
100 | 69 | | |
101 | 70 | | |
| |||
142 | 111 | | |
143 | 112 | | |
144 | 113 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | 114 | | |
154 | 115 | | |
155 | 116 | | |
| |||
209 | 170 | | |
210 | 171 | | |
211 | 172 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | 173 | | |
221 | 174 | | |
222 | 175 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | 188 | | |
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
193 | | - | |
194 | 192 | | |
195 | 193 | | |
196 | 194 | | |
| |||
241 | 239 | | |
242 | 240 | | |
243 | 241 | | |
244 | | - | |
245 | 242 | | |
246 | | - | |
247 | 243 | | |
248 | 244 | | |
249 | 245 | | |
| |||
705 | 701 | | |
706 | 702 | | |
707 | 703 | | |
708 | | - | |
709 | 704 | | |
710 | 705 | | |
711 | 706 | | |
712 | 707 | | |
713 | 708 | | |
714 | 709 | | |
715 | | - | |
716 | 710 | | |
717 | 711 | | |
718 | 712 | | |
| |||
1825 | 1819 | | |
1826 | 1820 | | |
1827 | 1821 | | |
1828 | | - | |
1829 | 1822 | | |
1830 | 1823 | | |
1831 | 1824 | | |
1832 | | - | |
1833 | 1825 | | |
1834 | 1826 | | |
1835 | 1827 | | |
| |||
1920 | 1912 | | |
1921 | 1913 | | |
1922 | 1914 | | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
1923 | 1919 | | |
1924 | 1920 | | |
1925 | 1921 | | |
| |||
2087 | 2083 | | |
2088 | 2084 | | |
2089 | 2085 | | |
2090 | | - | |
2091 | | - | |
2092 | | - | |
2093 | | - | |
2094 | 2086 | | |
2095 | 2087 | | |
2096 | | - | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
2097 | 2091 | | |
2098 | | - | |
2099 | 2092 | | |
2100 | 2093 | | |
2101 | 2094 | | |
| |||
2176 | 2169 | | |
2177 | 2170 | | |
2178 | 2171 | | |
2179 | | - | |
2180 | 2172 | | |
2181 | 2173 | | |
2182 | | - | |
2183 | 2174 | | |
2184 | 2175 | | |
2185 | 2176 | | |
| |||
2347 | 2338 | | |
2348 | 2339 | | |
2349 | 2340 | | |
2350 | | - | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
2351 | 2365 | | |
2352 | 2366 | | |
2353 | 2367 | | |
| |||
2367 | 2381 | | |
2368 | 2382 | | |
2369 | 2383 | | |
2370 | | - | |
2371 | 2384 | | |
2372 | 2385 | | |
2373 | 2386 | | |
| |||
2511 | 2524 | | |
2512 | 2525 | | |
2513 | 2526 | | |
2514 | | - | |
2515 | 2527 | | |
2516 | 2528 | | |
2517 | | - | |
2518 | 2529 | | |
2519 | 2530 | | |
2520 | 2531 | | |
| |||
2563 | 2574 | | |
2564 | 2575 | | |
2565 | 2576 | | |
2566 | | - | |
2567 | 2577 | | |
2568 | 2578 | | |
2569 | 2579 | | |
2570 | 2580 | | |
2571 | | - | |
2572 | 2581 | | |
2573 | 2582 | | |
2574 | 2583 | | |
| |||
0 commit comments