bpf: lsm: Remove hook to bpf_task_storage_free
authorSong Liu <song@kernel.org>
Thu, 12 Dec 2024 07:59:56 +0000 (23:59 -0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 16 Dec 2024 20:32:31 +0000 (12:32 -0800)
free_task() already calls bpf_task_storage_free(). It is not necessary
to call it again on security_task_free(). Remove the hook.

Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Acked-by: Matt Bobrowski <mattbobrowski@google.com>
Link: https://patch.msgid.link/20241212075956.2614894-1-song@kernel.org
security/bpf/hooks.c

index 3663aec7bcbd21e411b28a630f216af6631cc3d1..db759025abe11f295deb96969c536d8d528721a8 100644 (file)
@@ -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 = {