Skip to contentSkip to conversation

bpf: lsm: Remove hook to bpf_task_storage_free

PATCH Applied Song Liu 3 participants 3 messages Dec 12, 2024 – Dec 16, 2024

Subsystems (3)
lore
Share & tools
lore

Song Liu

author reviewer
#0 lore raw

PATCH 1/1 bpf: lsm: Remove hook to bpf_task_storage_free

free_task() already calls bpf_task_storage_free(). It is not necessary to call it again on security_task_free(). Remove the hook.

---

This was initially sent in a patchset [1]. However, this patch is not closely related to other patches in the set, so sending it alone.

[1] https://lore.kernel.org/bpf/[email protected]/

---
 security/bpf/hooks.c | 1 -
 1 file changed, 1 deletion(-)
security/bpf/hooks.c +0 -1
index 3663aec7bcbd..db759025abe1 100644
@@ -13,7 +13,6 @@ static struct security_hook_list bpf_lsm_hooks[] __ro_after_init = {
 	#include <linux/lsm_hook_defs.h>
 	#undef LSM_HOOK
 	LSM_HOOK_INIT(inode_free_security, bpf_inode_storage_free),
-	LSM_HOOK_INIT(task_free, bpf_task_storage_free),
 };
 
 static const struct lsm_id bpf_lsmid = {
Signature · 1 line
2.43.5
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Song Liu

free_task() already calls bpf_task_storage_free(). It is not necessary to call it again on security_task_free(). Remove the hook.

Quoted 27 lines

---

This was initially sent in a patchset [1]. However, this patch is not closely related to other patches in the set, so sending it alone.

[1] https://lore.kernel.org/bpf/[email protected]/

---
 security/bpf/hooks.c | 1 -
 1 file changed, 1 deletion(-)
security/bpf/hooks.c +0 -1
index 3663aec7bcbd..db759025abe1 100644
@@ -13,7 +13,6 @@ static struct security_hook_list bpf_lsm_hooks[] __ro_after_init = {
 	#include <linux/lsm_hook_defs.h>
 	#undef LSM_HOOK
 	LSM_HOOK_INIT(inode_free_security, bpf_inode_storage_free),
-	LSM_HOOK_INIT(task_free, bpf_task_storage_free),
 };
 
 static const struct lsm_id bpf_lsmid = {
Signature · 1 line
2.43.5
#2 lore raw
In reply to Song Liu
This patch was applied to bpf/bpf-next.git (master) by Martin KaFai Lau <[email protected]>:

Hello:

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

Quoted 8 lines · On Wed, 11 Dec 2024 23:59:56 -0800 you wrote:

free_task() already calls bpf_task_storage_free(). It is not necessary to call it again on security_task_free(). Remove the hook.

---

[...]

Here is the summary with links:
- [bpf-next] bpf: lsm: Remove hook to bpf_task_storage_free

    https://git.kernel.org/bpf/bpf-next/c/58ecb3a789fd

You are awesome, thank you!

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