Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bpf: Document cfi_stubs and owner fields in struct bpf_struct_ops

Add missing kernel-doc documentation for the cfi_stubs and owner
fields in struct bpf_struct_ops to fix the following warnings:

Warning: include/linux/bpf.h:1931 struct member 'cfi_stubs' not
described in 'bpf_struct_ops'
Warning: include/linux/bpf.h:1931 struct member 'owner' not
described in 'bpf_struct_ops'

The cfi_stubs field was added in commit 2cd3e3772e41 ("x86/cfi,bpf:
Fix bpf_struct_ops CFI") to provide CFI stub functions for trampolines,
and the owner field is used for module reference counting.

Signed-off-by: Nirbhay Sharma <nirbhay.lkd@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20251120204620.59571-2-nirbhay.lkd@gmail.com

authored by

Nirbhay Sharma and committed by
Martin KaFai Lau
e0940c67 d088da90

+6 -4
+6 -4
include/linux/bpf.h
··· 1922 1922 * reason, if this callback is not defined, the check is skipped as 1923 1923 * the struct_ops map will have final verification performed in 1924 1924 * @reg. 1925 - * @type: BTF type. 1926 - * @value_type: Value type. 1925 + * @cfi_stubs: Pointer to a structure of stub functions for CFI. These stubs 1926 + * provide the correct Control Flow Integrity hashes for the 1927 + * trampolines generated by BPF struct_ops. 1928 + * @owner: The module that owns this struct_ops. Used for module reference 1929 + * counting to ensure the module providing the struct_ops cannot be 1930 + * unloaded while in use. 1927 1931 * @name: The name of the struct bpf_struct_ops object. 1928 1932 * @func_models: Func models 1929 - * @type_id: BTF type id. 1930 - * @value_id: BTF value id. 1931 1933 */ 1932 1934 struct bpf_struct_ops { 1933 1935 const struct bpf_verifier_ops *verifier_ops;