* [PATCH] bpf: Document cfi_stubs and owner fields in struct bpf_struct_ops
@ 2025-11-19 6:24 Nirbhay Sharma
2025-11-20 19:29 ` Martin KaFai Lau
0 siblings, 1 reply; 4+ messages in thread
From: Nirbhay Sharma @ 2025-11-19 6:24 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
Cc: Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
skhan, david.hunter.linux, linux-kernel-mentees, bpf,
linux-kernel, Nirbhay Sharma
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>
---
include/linux/bpf.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index d808253f2e94..d39b4b2c8f35 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1905,10 +1905,16 @@ struct btf_member;
* reason, if this callback is not defined, the check is skipped as
* the struct_ops map will have final verification performed in
* @reg.
- * @type: BTF type.
- * @value_type: Value type.
+ * @cfi_stubs: Pointer to a structure of stub functions for CFI. These stubs
+ * provide the correct Control Flow Integrity hashes for the
+ * trampolines generated by BPF struct_ops.
+ * @owner: The module that owns this struct_ops. Used for module reference
+ * counting to ensure the module providing the struct_ops cannot be
+ * unloaded while in use.
* @name: The name of the struct bpf_struct_ops object.
* @func_models: Func models
+ * @type: BTF type.
+ * @value_type: Value type.
* @type_id: BTF type id.
* @value_id: BTF value id.
*/
--
2.48.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] bpf: Document cfi_stubs and owner fields in struct bpf_struct_ops
2025-11-19 6:24 [PATCH] bpf: Document cfi_stubs and owner fields in struct bpf_struct_ops Nirbhay Sharma
@ 2025-11-20 19:29 ` Martin KaFai Lau
2025-11-20 20:46 ` [PATCH v2] " Nirbhay Sharma
0 siblings, 1 reply; 4+ messages in thread
From: Martin KaFai Lau @ 2025-11-20 19:29 UTC (permalink / raw)
To: Nirbhay Sharma
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, John Fastabend,
KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa, skhan,
david.hunter.linux, linux-kernel-mentees, bpf, linux-kernel
On 11/18/25 10:24 PM, Nirbhay Sharma wrote:
> 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>
> ---
> include/linux/bpf.h | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> index d808253f2e94..d39b4b2c8f35 100644
> --- a/include/linux/bpf.h
> +++ b/include/linux/bpf.h
> @@ -1905,10 +1905,16 @@ struct btf_member;
> * reason, if this callback is not defined, the check is skipped as
> * the struct_ops map will have final verification performed in
> * @reg.
> - * @type: BTF type.
> - * @value_type: Value type.
> + * @cfi_stubs: Pointer to a structure of stub functions for CFI. These stubs
> + * provide the correct Control Flow Integrity hashes for the
> + * trampolines generated by BPF struct_ops.
> + * @owner: The module that owns this struct_ops. Used for module reference
> + * counting to ensure the module providing the struct_ops cannot be
> + * unloaded while in use.
> * @name: The name of the struct bpf_struct_ops object.
> * @func_models: Func models
> + * @type: BTF type.
> + * @value_type: Value type.
> * @type_id: BTF type id.
> * @value_id: BTF value id.
Please take this chance to remove all doc after func_models. Meaning
remove type, value_type, type_id, and value_id. They were removed in
commit 4c5763ed996a.
pw-bot: cr
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v2] bpf: Document cfi_stubs and owner fields in struct bpf_struct_ops
2025-11-20 19:29 ` Martin KaFai Lau
@ 2025-11-20 20:46 ` Nirbhay Sharma
2025-11-20 22:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 4+ messages in thread
From: Nirbhay Sharma @ 2025-11-20 20:46 UTC (permalink / raw)
To: ast, daniel, andrii
Cc: martin.lau, eddyz87, song, yonghong.song, john.fastabend, kpsingh,
sdf, haoluo, jolsa, skhan, david.hunter.linux,
linux-kernel-mentees, bpf, linux-kernel, Nirbhay Sharma
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>
---
Changes in v2:
- Removed documentation for non-existent fields (type, value_type, type_id,
value_id) that were moved to bpf_struct_ops_desc in commit 4c5763ed996a
include/linux/bpf.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index d808253f2e94..96851fa0494f 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -1905,12 +1905,14 @@ struct btf_member;
* reason, if this callback is not defined, the check is skipped as
* the struct_ops map will have final verification performed in
* @reg.
- * @type: BTF type.
- * @value_type: Value type.
+ * @cfi_stubs: Pointer to a structure of stub functions for CFI. These stubs
+ * provide the correct Control Flow Integrity hashes for the
+ * trampolines generated by BPF struct_ops.
+ * @owner: The module that owns this struct_ops. Used for module reference
+ * counting to ensure the module providing the struct_ops cannot be
+ * unloaded while in use.
* @name: The name of the struct bpf_struct_ops object.
* @func_models: Func models
- * @type_id: BTF type id.
- * @value_id: BTF value id.
*/
struct bpf_struct_ops {
const struct bpf_verifier_ops *verifier_ops;
--
2.48.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] bpf: Document cfi_stubs and owner fields in struct bpf_struct_ops
2025-11-20 20:46 ` [PATCH v2] " Nirbhay Sharma
@ 2025-11-20 22:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-20 22:10 UTC (permalink / raw)
To: Nirbhay Sharma
Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song,
john.fastabend, kpsingh, sdf, haoluo, jolsa, skhan,
david.hunter.linux, linux-kernel-mentees, bpf, linux-kernel
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:
On Fri, 21 Nov 2025 02:16:21 +0530 you wrote:
> 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'
>
> [...]
Here is the summary with links:
- [v2] bpf: Document cfi_stubs and owner fields in struct bpf_struct_ops
https://git.kernel.org/bpf/bpf-next/c/e0940c672ab4
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-11-20 22:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19 6:24 [PATCH] bpf: Document cfi_stubs and owner fields in struct bpf_struct_ops Nirbhay Sharma
2025-11-20 19:29 ` Martin KaFai Lau
2025-11-20 20:46 ` [PATCH v2] " Nirbhay Sharma
2025-11-20 22:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox