aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2023-03-31 17:51:03 -0700
committerAlexei Starovoitov <ast@kernel.org>2023-03-31 17:51:03 -0700
commitbdbf1ffe1cf9ba75df39e8f788cde0e9c2641b86 (patch)
treeca60a8493bce10b71b653c8c8ad2808237a62955
parentd838269c7a56a11ca746d4f268c983355dabf51b (diff)
downloadbpf-master.tar.gz
bpf: wip.HEADmaster
this should be MAYBE_NULL. Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r--kernel/bpf/verifier.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 19d0c39c6d702a..8af3844ed34dbc 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -5391,12 +5391,25 @@ BTF_TYPE_SAFE_RCU(struct task_struct) {
struct css_set __rcu *cgroups;
struct task_struct __rcu *real_parent;
struct task_struct *group_leader;
+ struct mm_struct *mm;
+};
+
+BTF_TYPE_SAFE_RCU(struct cgroup) {
+ struct kernfs_node *kn;
};
BTF_TYPE_SAFE_RCU(struct css_set) {
struct cgroup *dfl_cgrp;
};
+BTF_TYPE_SAFE_RCU(struct mm_struct) {
+ struct file __rcu *exe_file;
+};
+
+BTF_TYPE_SAFE_RCU(struct sk_buff) {
+ struct sock *sk;
+};
+
/* full trusted: these fields are trusted even outside of RCU CS and never NULL */
BTF_TYPE_SAFE_TRUSTED(struct bpf_iter_meta) {
struct seq_file *seq;
@@ -5429,7 +5442,10 @@ static bool type_is_rcu(struct bpf_verifier_env *env,
const char *field_name, u32 btf_id)
{
BTF_TYPE_EMIT(BTF_TYPE_SAFE_RCU(struct task_struct));
+ BTF_TYPE_EMIT(BTF_TYPE_SAFE_RCU(struct cgroup));
BTF_TYPE_EMIT(BTF_TYPE_SAFE_RCU(struct css_set));
+ BTF_TYPE_EMIT(BTF_TYPE_SAFE_RCU(struct mm_struct));
+ BTF_TYPE_EMIT(BTF_TYPE_SAFE_RCU(struct sk_buff));
return btf_nested_type_is_trusted(&env->log, reg, field_name, btf_id, "__safe_rcu");
}