Lines Matching defs:kfunc

1123 			"belongs to the %s IRQ kfunc family. Save and restore operations "
1127 "Restore the flag with the matching IRQ restore kfunc for the save "
2566 verbose(env, "kfunc fd_idx %u out of bounds, fd_array_cnt %u\n",
2572 verbose(env, "kfunc fd_idx %u is not a module BTF\n", idx);
2607 verbose(env, "kfunc offset > 0 without fd_array is invalid\n");
2633 verbose(env, "BTF fd for kfunc is not a module BTF\n");
2741 struct bpf_kfunc_meta *kfunc)
2762 * kfunc_id_set. This most likely indicates an invalid kfunc
2764 * and let the caller decide what to do with NULL kfunc->flags.
2777 * An actual prototype of a kfunc with KF_IMPLICIT_ARGS flag
2778 * can be found through the counterpart _impl kfunc.
2791 memset(kfunc, 0, sizeof(*kfunc));
2792 kfunc->btf = btf;
2793 kfunc->id = func_id;
2794 kfunc->name = func_name;
2795 kfunc->proto = func_proto;
2796 kfunc->flags = kfunc_flags;
2811 struct bpf_kfunc_meta kfunc;
2872 err = fetch_kfunc_meta(env, func_id, offset, &kfunc);
2876 addr = kallsyms_lookup_name(kfunc.name);
2878 verbose(env, "cannot find address for kernel function %s\n", kfunc.name);
2888 err = btf_distill_func_proto(&env->log, kfunc.btf, kfunc.proto, kfunc.name, &func_model);
2893 meta.btf = kfunc.btf;
2894 meta.func_id = kfunc.id;
2895 meta.func_proto = kfunc.proto;
2896 meta.func_name = kfunc.name;
2897 meta.kfunc_flags = kfunc.flags ? *kfunc.flags : 0;
5430 "bpf_throw kfunc (insn %d) cannot be called from callback subprog %d\n",
7587 * Validate dynptr arguments for helper, kfunc and subprog.
7649 "This kfunc constructs a dynptr and requires an uninitialized dynptr stack slot, but the selected slot already holds dynptr state.",
7739 * kfunc is iter state pointer
7744 /* iter passed as an argument to a generic kfunc */
7770 * to any kfunc, if arg has "__iter" suffix, we need to be a bit more
7779 "the kfunc expects a recognized iterator state pointer, but this argument does not match a valid iterator type",
7780 "Pass the exact iterator state type expected by this kfunc.");
7809 /* iter_next() or iter_destroy(), as well as any kfunc
7822 "Call the matching iterator new kfunc on every path before calling next or destroy, and do not destroy the iterator before this use.");
8518 verbose(env, "%s must have zero offset when passed to release func or trusted arg to kfunc\n",
9874 verifier_bug(env, "kfunc %s#%d not marked as callback-calling",
10328 * Are we currently verifying the callback for an rbtree kfunc that must
11617 * A kfunc with KF_IMPLICIT_ARGS has two prototypes in BTF:
11986 /* In this function, we verify the kfunc's BTF as per the argument type,
12033 verbose(env, "JIT does not support kfunc %s() with arena pointer arguments\n",
12104 verbose(env, "JIT does not support kfunc %s() with %d args\n",
12164 * bpf_cpumask * to a kfunc expecting a struct cpumask *.
12183 /* If kfunc is accepting a projection type (ie. __sk_buff), it cannot
12215 verifier_bug(env, "unknown irq flags kfunc");
12249 "the matching IRQ save kfunc.");
12415 struct bpf_kfunc_meta kfunc;
12418 err = fetch_kfunc_meta(env, func_id, offset, &kfunc);
12419 if (err || !kfunc.flags)
12422 return *kfunc.flags & KF_SPINLOCK_SAFE;
12478 verbose(env, "verifier internal error: %s head arg for unknown kfunc\n",
12509 verbose(env, "verifier internal error: %s node arg for unknown kfunc\n",
12527 verifier_bug(env, "unexpected btf mismatch in kfunc call");
12595 verifier_bug(env, "unexpected btf mismatch in kfunc call");
12722 verifier_bug(env, "Only 1 prog->aux argument supported per-kfunc");
12754 "Add a NULL check and call the kfunc only on the non-NULL path.",
12755 "the pointer may be NULL, but this kfunc requires a non-NULL value of type %s",
12765 verbose(env, "release kfunc %s expects referenced PTR_TO_BTF_ID passed to %s\n",
12768 "Pass the resource-owning pointer returned by the matching acquire kfunc, and avoid calling the release kfunc after ownership has already been transferred or released.",
12769 "release kfuncs require a resource-owning value of type %s returned by a matching acquire kfunc",
12825 verifier_bug(env, "unknown kfunc arg type %d", kf_arg_type);
12842 "the kfunc expects an integer scalar, but %s is %s",
12853 "the kfunc requires this scalar argument to be a verifier-known constant, but %s is variable on this path",
12863 "the kfunc expects an integer scalar, but %s is %s",
12874 "the kfunc expects an integer scalar, but %s is %s",
12886 "Pass a verifier-known constant size for this kfunc buffer argument.",
12887 "the kfunc uses this argument as a return-buffer size, but %s is invalid or variable on this path",
12898 "the kfunc expects a context pointer, but %s is %s",
12936 "the kfunc expects an allocated object pointer, but %s is %s",
13105 "Pass a pointer acquired from a verifier-tracked source, or call this kfunc only inside the required protection if it accepts RCU pointers.",
13106 "the kfunc requires a trusted or resource-owning pointer to %s, but %s is %s",
13119 "Use this kfunc with a pointer that is valid in an RCU read lock region.",
13120 "the kfunc requires an RCU-protected pointer to %s, but %s is %s",
13147 "the kfunc expects a pointer to %s, but this argument is %s and cannot be used as that kernel object pointer",
13180 "the kfunc expects %u bytes of memory for %s, but the verifier cannot prove that %s provides a readable and writable range of that size",
13187 "the kfunc expects %u bytes of memory for %s, but it is %s and not verifier-known memory",
13200 "the kfunc requires this memory size to be a verifier-known constant, but %s is variable on this path",
13216 "the kfunc expects a scalar memory size, but %s is %s",
13271 "the kfunc expects a pointer to a BPF-managed refcounted object, but %s is %s",
13300 "the kfunc expects a pointer to a constant string stored in verifier-known memory, but %s is %s",
13345 "the kfunc expects a stack pointer to an IRQ flag slot, but %s is %s",
13393 struct bpf_kfunc_meta kfunc;
13398 err = fetch_kfunc_meta(env, func_id, offset, &kfunc);
13402 meta->btf = kfunc.btf;
13403 meta->func_id = kfunc.id;
13404 meta->func_proto = kfunc.proto;
13405 meta->func_name = kfunc.name;
13407 if (!kfunc.flags || !btf_kfunc_is_allowed(kfunc.btf, kfunc.id, env->prog))
13410 meta->kfunc_flags = *kfunc.flags;
13538 * Determine how many bytes a kfunc accesses through a stack pointer at
13726 verbose(env, "Unknown type ID %lld passed to kfunc bpf_rdonly_cast\n",
13740 "kfunc bpf_rdonly_cast type ID argument must be of a struct or void\n");
13807 operation = bpf_diag_fmt(env, "kfunc %s", meta.func_name);
13809 env, insn_idx, operation, "this program cannot call the kfunc",
13810 "Use a kfunc allowed for this program type and attach point, or change the program context.");
13820 verifier_bug(env, "kfunc descriptor not found for func_id %u", insn->imm);
13857 verbose(env, "destructive kfunc calls require CAP_SYS_BOOT capability\n");
13858 operation = bpf_diag_fmt(env, "destructive kfunc %s", meta.func_name);
13868 operation = bpf_diag_fmt(env, "kfunc %s", func_name);
13869 bpf_diag_policy(env, insn_idx, operation, "the kfunc requires CAP_PERFMON",
13870 "Load the program with CAP_PERFMON, or avoid the kfunc.");
13876 verbose(env, "program must be sleepable to call sleepable kfunc %s\n", func_name);
13877 operation = bpf_diag_fmt(env, "sleepable kfunc %s", func_name);
13879 "Mark the program sleepable if the program type allows it, or use a non-sleepable kfunc.");
13911 verbose(env, "kfunc %s#%d failed callback verification\n",
13921 verbose(env, "kfunc %s#%d failed callback verification\n",
13931 verbose(env, "kfunc %s#%d failed callback verification\n",
13982 operation = bpf_diag_fmt(env, "sleepable kfunc %s", func_name);
13984 "Move the kfunc call outside the critical section, or use a non-sleepable kfunc.");
13997 "Call this kfunc between bpf_rcu_read_lock() and bpf_rcu_read_unlock(), keeping all exit paths balanced.");
14019 verbose(env, "JIT does not support calling kfunc %s#%d\n",
14069 /* kfunc returning 'void *' is equivalent to returning scalar */
14124 * annotated with BPF kfunc flag
14135 * kfunc should by default be treated as
17726 /* If @call is a kfunc or helper call, fills @cs and returns true,
17863 * by a call to a helper/kfunc *as if* this helper/kfunc follows
20058 * KF_IMPLICIT_ARGS kfunc has its injected args stripped from the public
20088 bpf_log(log, "kfunc %s has inconsistent KF_IMPLICIT_ARGS\n", name);
20810 /* replace a generic kfunc with a specialized version if necessary */
20828 /* fallback to default kfunc when not supported by netdev */
21351 /* Build kfunc prototypes after resolving program resources. */