Commit b9d7592
bpf: Add bpf_get_task_cmdline kfunc
Add the bpf_get_task_cmdline kfunc. One use case is as follows: In
production environments, there are often short-lived script tasks executed,
and sometimes these tasks may cause stability issues. It is desirable to
detect these script tasks via eBPF. The common approach is to check
the process name, but it can be difficult to distinguish specific
tasks in some cases. Take the shell as an example: some tasks are
started via bash xxx.sh – their process name is bash, but the script
name of the task can be obtained through the cmdline. Additionally,
myabe this is helpful for security auditing purposes.
Signed-off-by: Tao Chen <[email protected]>1 parent b0a5b86 commit b9d7592
1 file changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2688 | 2688 | | |
2689 | 2689 | | |
2690 | 2690 | | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
2691 | 2712 | | |
2692 | 2713 | | |
2693 | 2714 | | |
| |||
4428 | 4449 | | |
4429 | 4450 | | |
4430 | 4451 | | |
| 4452 | + | |
4431 | 4453 | | |
4432 | 4454 | | |
4433 | 4455 | | |
| |||
0 commit comments