SEC("tp_btf/task_newtask")
__failure __msg("bpf_cpumask_set_cpu args#1 expected pointer to STRUCT bpf_cpumask") int BPF_PROG(test_mutate_cpumask, struct task_struct *task, u64 clone_flags)
{ /* Can't set the CPU of a non-struct bpf_cpumask. */
bpf_cpumask_set_cpu(0, (struct bpf_cpumask *)task->cpus_ptr);
cpumask = create_cpumask(); if (!cpumask) return 0;
if (cpumask_map_insert(cpumask)) return 0;
v = cpumask_map_value_lookup(); if (!v) return 0;
cpumask = bpf_kptr_xchg(&v->cpumask, NULL);
/* cpumask is never released. */ return 0;
}
SEC("tp_btf/task_newtask")
__failure __msg("NULL pointer passed to trusted arg0") int BPF_PROG(test_cpumask_null, struct task_struct *task, u64 clone_flags)
{ /* NULL passed to KF_TRUSTED_ARGS kfunc. */
bpf_cpumask_empty(NULL);
return 0;
}
SEC("tp_btf/task_newtask")
__failure __msg("R2 must be a rcu pointer") int BPF_PROG(test_global_mask_out_of_rcu, struct task_struct *task, u64 clone_flags)
{ struct bpf_cpumask *local, *prev;
ret = bpf_cpumask_populate((struct cpumask *)invalid, &bits, sizeof(bits)); if (!ret)
err = 2;
return 0;
}
SEC("tp_btf/task_newtask")
__failure __msg("leads to invalid memory access") int BPF_PROG(test_populate_invalid_source, struct task_struct *task, u64 clone_flags)
{ void *garbage = (void *)0x123456; struct bpf_cpumask *local; int ret;
local = create_cpumask(); if (!local) {
err = 1; return 0;
}
ret = bpf_cpumask_populate((struct cpumask *)local, garbage, 8); if (!ret)
err = 2;
bpf_cpumask_release(local);
return 0;
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.0Bemerkung:
(vorverarbeitet am 2026-04-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.