Skip to contentSkip to conversation

bpf: lsm: Set bpf_lsm_blob_sizes.lbs_task to 0

PATCH Applied Song Liu 3 participants 3 messages Sep 11, 2024

Subsystems (4)
lore
Share & tools
lore

Song Liu

author reviewer
#0 lore raw

PATCH 1/1 bpf: lsm: Set bpf_lsm_blob_sizes.lbs_task to 0

bpf task local storage is now using task_struct->bpf_storage, so bpf_lsm_blob_sizes.lbs_task is no longer needed. Remove it to save some memory.

Fixes a10787e6d58c ("bpf: Enable task local storage for tracing programs")
Cc KP Singh <[email protected]>
Cc Matt Bobrowski <[email protected]>
---
 security/bpf/hooks.c | 1 -
 1 file changed, 1 deletion(-)
security/bpf/hooks.c +0 -1
index 57b9ffd53c98..3663aec7bcbd 100644
@@ -31,7 +31,6 @@ static int __init bpf_lsm_init(void)
 
 struct lsm_blob_sizes bpf_lsm_blob_sizes __ro_after_init = {
 	.lbs_inode = sizeof(struct bpf_storage_blob),
-	.lbs_task = sizeof(struct bpf_storage_blob),
 };
 
 DEFINE_LSM(bpf) = {
Signature · 1 line
2.43.5
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Song Liu

bpf task local storage is now using task_struct->bpf_storage, so bpf_lsm_blob_sizes.lbs_task is no longer needed. Remove it to save some memory.

Makes sense to me.

Quoted 23 lines
Fixes a10787e6d58c ("bpf: Enable task local storage for tracing programs")
Cc KP Singh <[email protected]>
Cc Matt Bobrowski <[email protected]>
---
 security/bpf/hooks.c | 1 -
 1 file changed, 1 deletion(-)
security/bpf/hooks.c +0 -1
index 57b9ffd53c98..3663aec7bcbd 100644
@@ -31,7 +31,6 @@ static int __init bpf_lsm_init(void)
 
 struct lsm_blob_sizes bpf_lsm_blob_sizes __ro_after_init = {
 	.lbs_inode = sizeof(struct bpf_storage_blob),
-	.lbs_task = sizeof(struct bpf_storage_blob),
 };
 
 DEFINE_LSM(bpf) = {
Signature · 1 line
2.43.5

/M

#2 lore raw
In reply to Song Liu
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 11 lines · On Tue, 10 Sep 2024 22:55:08 -0700 you wrote:

bpf task local storage is now using task_struct->bpf_storage, so bpf_lsm_blob_sizes.lbs_task is no longer needed. Remove it to save some memory.

Fixes a10787e6d58c ("bpf: Enable task local storage for tracing programs")
Cc KP Singh <[email protected]>
Cc Matt Bobrowski <[email protected]>

[...]

Here is the summary with links:
- [bpf-next] bpf: lsm: Set bpf_lsm_blob_sizes.lbs_task to 0

    https://git.kernel.org/bpf/bpf-next/c/300a90b2cb5d

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html