bpf: Drop task_to_inode and inet_conn_established from lsm sleepable hooks
PATCH 1/1 bpf: Drop task_to_inode and inet_conn_established from lsm sleepable hooks
bpf_lsm_task_to_inode() is called under rcu_read_lock() and bpf_lsm_inet_conn_established() is called from softirq context, so neither hook can be used by sleepable LSM programs.
Fixes 423f16108c9d8 ("bpf: Augment the set of sleepable LSM hooks")
Reported-by Quan Sun <[email protected]>
Reported-by Yinhao Hu <[email protected]>
Reported-by Kaiyan Mei <[email protected]>
Reported-by Dongliang Mu <[email protected]>
Signed-off-by Jiayuan Chen <[email protected]>
--- kernel/bpf/bpf_lsm.c | 3 --- 1 file changed, 3 deletions(-)
kernel/bpf/bpf_lsm.c +0 -3
@@ -359,8 +359,6 @@ BTF_ID(func, bpf_lsm_sb_umount) BTF_ID(func, bpf_lsm_settime)#ifdef CONFIG_SECURITY_NETWORK -BTF_ID(func, bpf_lsm_inet_conn_established) - BTF_ID(func, bpf_lsm_socket_accept) BTF_ID(func, bpf_lsm_socket_bind)BTF_ID (func, bpf_lsm_socket_connect)
@@ -381,7 +379,6 @@ BTF_ID(func, bpf_lsm_syslog) BTF_ID(func, bpf_lsm_task_alloc) BTF_ID(func, bpf_lsm_task_prctl) BTF_ID(func, bpf_lsm_task_setscheduler) -BTF_ID(func, bpf_lsm_task_to_inode) BTF_ID(func, bpf_lsm_userns_create) BTF_ID(func, bpf_lsm_bdev_alloc_security)BTF_ID (func, bpf_lsm_bdev_setintegrity)
Signature · 1 line
2.43.0
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 12 lines · On Tue, 7 Apr 2026 20:23:33 +0800 you wrote:
bpf_lsm_task_to_inode()is called underrcu_read_lock()andbpf_lsm_inet_conn_established()is called from softirq context, so neither hook can be used by sleepable LSM programs.Fixes 423f16108c9d8 ("bpf: Augment the set of sleepable LSM hooks")Reported-by Quan Sun <[email protected]>Reported-by Yinhao Hu <[email protected]>Reported-by Kaiyan Mei <[email protected]>Reported-by Dongliang Mu <[email protected]>Signed-off-by Jiayuan Chen <[email protected]>
Quoted 1 line
[...]
Here is the summary with links:
- [bpf] bpf: Drop task_to_inode and inet_conn_established from lsm sleepable hooks
https://git.kernel.org/bpf/bpf-next/c/beaf0e96b1da
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html