Lines Matching +full:local +full:- +full:pid

1 // SPDX-License-Identifier: GPL-2.0
17 int inode_storage_result = -1;
18 int sk_storage_result = -1;
19 int task_storage_result = -1;
64 __u32 pid = bpf_get_current_pid_tgid() >> 32; in BPF_PROG() local
70 if (pid != monitored_pid) in BPF_PROG()
77 task_storage_result = -1; in BPF_PROG()
84 is_self_unlink = storage->exec_inode == victim->d_inode; in BPF_PROG()
88 if (!storage || storage->value) in BPF_PROG()
98 local_storage = task->bpf_storage; in BPF_PROG()
99 if (!local_storage || local_storage->smap) in BPF_PROG()
104 return is_self_unlink ? -EPERM : 0; in BPF_PROG()
115 /* new_dentry->d_inode can be NULL when the inode is renamed to a file in BPF_PROG()
119 bpf_inode_storage_get(&inode_storage_map, new_dentry->d_inode, 0, in BPF_PROG()
122 storage = bpf_inode_storage_get(&inode_storage_map, old_dentry->d_inode, in BPF_PROG()
127 if (storage->value != DUMMY_STORAGE_VALUE) in BPF_PROG()
128 inode_storage_result = -1; in BPF_PROG()
130 err = bpf_inode_storage_delete(&inode_storage_map, old_dentry->d_inode); in BPF_PROG()
141 __u32 pid = bpf_get_current_pid_tgid() >> 32; in BPF_PROG() local
144 if (pid != monitored_pid) in BPF_PROG()
147 storage = bpf_sk_storage_get(&sk_storage_map, sock->sk, 0, 0); in BPF_PROG()
151 sk_storage_result = -1; in BPF_PROG()
152 if (storage->value != DUMMY_STORAGE_VALUE) in BPF_PROG()
156 * with the local storage. in BPF_PROG()
158 storage = bpf_sk_storage_get(&sk_storage_map2, sock->sk, 0, in BPF_PROG()
163 if (bpf_sk_storage_delete(&sk_storage_map2, sock->sk)) in BPF_PROG()
166 storage = bpf_sk_storage_get(&sk_storage_map2, sock->sk, 0, in BPF_PROG()
171 if (bpf_sk_storage_delete(&sk_storage_map, sock->sk)) in BPF_PROG()
175 if (!sock->sk->sk_bpf_storage || sock->sk->sk_bpf_storage->smap) in BPF_PROG()
186 __u32 pid = bpf_get_current_pid_tgid() >> 32; in BPF_PROG() local
189 if (pid != monitored_pid) in BPF_PROG()
192 storage = bpf_sk_storage_get(&sk_storage_map, sock->sk, 0, in BPF_PROG()
197 storage->value = DUMMY_STORAGE_VALUE; in BPF_PROG()
202 /* This uses the local storage to remember the inode of the binary that a
208 __u32 pid = bpf_get_current_pid_tgid() >> 32; in BPF_PROG() local
211 if (pid != monitored_pid) in BPF_PROG()
218 storage->exec_inode = bprm->file->f_inode; in BPF_PROG()
220 storage = bpf_inode_storage_get(&inode_storage_map, bprm->file->f_inode, in BPF_PROG()
225 storage->value = DUMMY_STORAGE_VALUE; in BPF_PROG()