1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2021 Facebook */
4 #include <bpf/bpf_helpers.h>
6 char _license[] SEC("license") = "GPL";
12 static long write_task(struct task_struct *task, struct vm_area_struct *vma,
13 struct callback_ctx *data)
15 /* writing to task, which is illegal */
21 SEC("raw_tp/sys_enter")
22 int handle_getpid(void)
24 struct task_struct *task = bpf_get_current_task_btf();
25 struct callback_ctx data = {};
27 bpf_find_vma(task, 0, write_task, &data, 0);