Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 6.6.y] Backport request: beaf0e96b1da ("bpf, lsm: Remove inet_conn_established from sleepable hooks", CVE-2026-63865)
@ 2026-11-19  5:56 梓川咲太
  2026-11-19 16:08 ` Sasha Levin
  0 siblings, 1 reply; 4+ messages in thread
From: 梓川咲太 @ 2026-11-19  5:56 UTC (permalink / raw)
  To: stable; +Cc: bpf, gregkh, sashal

Hi Stable Maintainers,

Please consider backporting upstream commit:

  beaf0e96b1da ("bpf, lsm: Remove inet_conn_established from sleepable hooks")

(CVE-2026-63865) to linux-6.6.y.

While v6.12.118 already has this fix, linux-6.6.y (tested on v6.6.162,
kernel/bpf/bpf_lsm.c:309) still retains BTF_ID(func,
bpf_lsm_inet_conn_established)
in sleepable_lsm_hooks. The hook is invoked in TCP established state under
atomic softirq context, leading to sleeping-in-atomic bugs when attached BPF
programs sleep.

The backport is a clean single-line removal of line 309 in kernel/bpf/bpf_lsm.c.

Fixes: 9e1026079c65 ("bpf: Add bpf_lsm_inet_conn_established")
Signed-off-by: BoBppy <inkxiao12@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 6.6.y] Backport request: beaf0e96b1da ("bpf, lsm: Remove inet_conn_established from sleepable hooks", CVE-2026-63865)
  2026-11-19  5:56 [PATCH 6.6.y] Backport request: beaf0e96b1da ("bpf, lsm: Remove inet_conn_established from sleepable hooks", CVE-2026-63865) 梓川咲太
@ 2026-11-19 16:08 ` Sasha Levin
  0 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2026-11-19 16:08 UTC (permalink / raw)
  To: stable; +Cc: Sasha Levin, bpf, gregkh, 梓川咲太

> Please consider backporting upstream commit:
>
>   beaf0e96b1da ("bpf, lsm: Remove inet_conn_established from sleepable hooks")
>
> (CVE-2026-63865) to linux-6.6.y.

beaf0e96b1da ("bpf: Drop task_to_inode and inet_conn_established
from lsm sleepable hooks") is already in 6.6, 6.1 and 5.15, but those
backports only removed bpf_lsm_task_to_inode.

I queued a follow-up that drops bpf_lsm_inet_conn_established from
sleepable_lsm_hooks for 6.6, 6.1 and 5.15, with you as Reported-by.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 6.6.y] Backport request: beaf0e96b1da ("bpf, lsm: Remove inet_conn_established from sleepable hooks", CVE-2026-63865)
       [not found] <CAMcAce8Mq7FLgzAMgnTQF=iB8V+XZ57wCCu7S0-ULTE_UF68ew@mail.gmail.com>
@ 2026-11-26 14:23 ` Greg KH
  2026-11-26 15:52   ` [PATCH 6.6.y] bpf: Drop inet_conn_established from lsm sleepable hooks Yingke Xiao
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2026-11-26 14:23 UTC (permalink / raw)
  To: 梓川咲太; +Cc: stable, bpf, sashal

On Thu, Nov 19, 2026 at 12:40:36AM -0500, 梓川咲太 wrote:
> Hi Stable Maintainers,
> 
> Please consider backporting upstream commit:
> 
>   beaf0e96b1da ("bpf, lsm: Remove inet_conn_established from sleepable
> hooks")
> 
> (CVE-2026-63865) to linux-6.6.y.
> 
> While v6.12.118 already has this fix, linux-6.6.y (tested on v6.6.162,
> kernel/bpf/bpf_lsm.c:309) still retains BTF_ID(func,
> bpf_lsm_inet_conn_established)
> in sleepable_lsm_hooks. The hook is invoked in TCP established state under
> atomic softirq context, leading to sleeping-in-atomic bugs when attached BPF
> programs sleep.
> 
> The backport is a clean single-line removal of line 309 in
> kernel/bpf/bpf_lsm.c.
> 
> Fixes: 9e1026079c65 ("bpf: Add bpf_lsm_inet_conn_established")
> Signed-off-by: BoBppy <inkxiao12@gmail.com>

Please provide a backported and tested version.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 6.6.y] bpf: Drop inet_conn_established from lsm sleepable hooks
  2026-11-26 14:23 ` [PATCH 6.6.y] Backport request: beaf0e96b1da ("bpf, lsm: Remove inet_conn_established from sleepable hooks", CVE-2026-63865) Greg KH
@ 2026-11-26 15:52   ` Yingke Xiao
  0 siblings, 0 replies; 4+ messages in thread
From: Yingke Xiao @ 2026-11-26 15:52 UTC (permalink / raw)
  To: stable; +Cc: gregkh, sashal, bpf, Yingke Xiao

The backport of upstream commit beaf0e96b1da ("bpf: Drop task_to_inode and
inet_conn_established from lsm sleepable hooks") to linux-6.6.y (commit
26b380a3ca0b) removed only bpf_lsm_task_to_inode from
sleepable_lsm_hooks.

bpf_lsm_inet_conn_established is still listed in sleepable_lsm_hooks in
kernel/bpf/bpf_lsm.c, even though security_inet_conn_established() is
called from softirq context in tcp_finish_connect() (net/ipv4/tcp_input.c)
and cannot be used by sleepable LSM programs (CVE-2026-63865).

Remove bpf_lsm_inet_conn_established from sleepable_lsm_hooks to complete
the backport on linux-6.6.y.

Fixes: 26b380a3ca0b ("bpf: Drop task_to_inode and inet_conn_established from lsm sleepable hooks")
Signed-off-by: Yingke Xiao <inkxiao12@gmail.com>
---
Tested on linux-6.6.y (v6.6.163, x86_64 QEMU with CONFIG_BPF_LSM=y,
CONFIG_DEBUG_INFO_BTF=y, CONFIG_SECURITY_NETWORK=y):
- Pre-patch: BPF_PROG_LOAD for SEC("lsm.s/inet_conn_established") with
  BPF_F_SLEEPABLE (calling bpf_copy_from_user) succeeded (prog_fd >= 0).
- Post-patch: BPF_PROG_LOAD rejected with -EINVAL
  ("bpf_lsm_inet_conn_established is not sleepable").

 kernel/bpf/bpf_lsm.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/kernel/bpf/bpf_lsm.c b/kernel/bpf/bpf_lsm.c
index 790451337..411622162 100644
--- a/kernel/bpf/bpf_lsm.c
+++ b/kernel/bpf/bpf_lsm.c
@@ -305,10 +305,6 @@ BTF_ID(func, bpf_lsm_file_lock)
 BTF_ID(func, bpf_lsm_file_open)
 BTF_ID(func, bpf_lsm_file_receive)
 
-#ifdef CONFIG_SECURITY_NETWORK
-BTF_ID(func, bpf_lsm_inet_conn_established)
-#endif /* CONFIG_SECURITY_NETWORK */
-
 BTF_ID(func, bpf_lsm_inode_create)
 BTF_ID(func, bpf_lsm_inode_free_security)
 BTF_ID(func, bpf_lsm_inode_getattr)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-26 15:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CAMcAce8Mq7FLgzAMgnTQF=iB8V+XZ57wCCu7S0-ULTE_UF68ew@mail.gmail.com>
2026-11-26 14:23 ` [PATCH 6.6.y] Backport request: beaf0e96b1da ("bpf, lsm: Remove inet_conn_established from sleepable hooks", CVE-2026-63865) Greg KH
2026-11-26 15:52   ` [PATCH 6.6.y] bpf: Drop inet_conn_established from lsm sleepable hooks Yingke Xiao
2026-11-19  5:56 [PATCH 6.6.y] Backport request: beaf0e96b1da ("bpf, lsm: Remove inet_conn_established from sleepable hooks", CVE-2026-63865) 梓川咲太
2026-11-19 16:08 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox