OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com, vladimir.riabchun@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.2 v2 00/15] ms: backport additional TFO and CALIPSO fixes
Date: Tue,  1 Dec 2026 14:10:15 +0200	[thread overview]
Message-ID: <20261201153749.2872789-1-eva.kurchatova@virtuozzo.com> (raw)

Patchset for tasks:
https://virtuozzo.atlassian.net/browse/VSTOR-157577
https://virtuozzo.atlassian.net/browse/VSTOR-158161
https://virtuozzo.atlassian.net/browse/VSTOR-158162
https://virtuozzo.atlassian.net/browse/VSTOR-158163
https://virtuozzo.atlassian.net/browse/VSTOR-158164

All patches are cherry-picks of 6.12.y, except 7, 8 and 12, which are
mainline only. Patch 3 is the 6.12.y prerequisite of 4, patch 14 is a
prerequisite to 15, and patch 8 has a rebase note for context conflict.

Patch 12 is the selftest to 11, and requires patch 2.

This fixes:
- BPF sock_ops callbacks on a child socket being force-closed (1).
- Sleeping under RCU when bpf_sock_destroy() closes a listener (2).
- bpf_sock_destroy() reading past TIME_WAIT and request sockets
  (Patch 11, selftest added in 12).
- CALIPSO: broken BIG TCP packets when a router labels them (3, 4),
  label cache never hit (5), packets dropped once the label is
  removed (6).
- Fast Open listener: NULL dereference on restart (7), request leak
  when listen() fails (8).
- Deferred Fast Open connect reporting sequence as send queue (13).
- CIPSO: options corrupted when the label is removed (14), options
  changed in place under lockless readers (15).
- NetLabel: IPv6 add errors ignored (9), short masks accepted (10).

Tested in QEMU with KASAN and DEBUG_ATOMIC_SLEEP, with and without the
patches: the bugs fixed by 2, 4-6, 9-11, 13 and 14 reproduce without
them and are gone when applied, labelling with Smack for CIPSO and with
an MLS policy in permissive mode for CALIPSO. Request migration, Fast
Open, SYN cookies and the TIME_WAIT purge pass with lockdep and
PROVE_RCU. The races fixed by 7, 8 and 15 no longer reproduce, and
patch 1 has no test of its own.

Changes in v2:
- Patches 9-15 are new (VSTOR-158161 to VSTOR-158164).
- Rebased on rh10-6.12.0-211.75.1.26.6.vz10, patches 1-8 unchanged.
- Reviewed-by: Sashiko on patches 1-8.

Link to v1: http://lore.virtuozzo.com/kernel/20261130184822.2743885-1-eva.kurchatova@virtuozzo.com/T/#t

Alice Mikityanska (1):
  ms/net/ipv6: Introduce payload_len helpers

Chenguang Zhao (2):
  ms/netlabel: fix IPv6 unlabeled address add error handling
  ms/netlabel: validate unlabeled address and mask attribute lengths

Eric Dumazet (1):
  ms/tcp: purge Fast Open RST queue when listen() fails

Hyunwoo Kim (1):
  ms/tcp: fix NULL pointer dereference when restarting a Fast Open
    listener

Jann Horn (1):
  ms/cipso: stop modifying live ip_options_rcu

Jiayuan Chen (3):
  ms/tcp: Skip cond_resched() in inet_csk_listen_stop() under BPF
    context
  ms/bpf: Fix out-of-bounds read of sk_protocol in bpf_sock_destroy()
  ms/selftests/bpf: Test bpf_sock_destroy() on TIME_WAIT and listener
    socks

Joas Antonio dos Santos (3):
  ms/calipso: keep BIG TCP payload_len in calipso_skbuff_setattr()
  ms/calipso: hash the cache key, not the option start, in
    calipso_cache_add()
  ms/calipso: update payload_len when removing the CALIPSO option

Qihang (1):
  ms/cipso: fix optlen corruption in cipso_v4_delopt()

Qingfang Deng (1):
  ms/tcp: initialize send sequence numbers before deferring TFO

Sechang Lim (1):
  ms/tcp: clear sock_ops cb flags before force-closing a child socket

 include/linux/ipv6.h                          |  22 ++++
 include/net/cipso_ipv4.h                      |  11 +-
 include/net/inet_connection_sock.h            |   8 +-
 include/net/ipv6.h                            |   2 -
 include/net/netfilter/nf_tables_ipv6.h        |   4 +-
 include/net/netlabel.h                        |  11 +-
 include/net/tcp.h                             |   9 ++
 net/bridge/br_netfilter_ipv6.c                |   2 +-
 net/bridge/netfilter/nf_conntrack_bridge.c    |   4 +-
 net/core/filter.c                             |  13 +-
 net/ipv4/cipso_ipv4.c                         |  25 +++-
 net/ipv4/inet_connection_sock.c               |  49 +++++--
 net/ipv4/tcp_fastopen.c                       |   2 +
 net/ipv6/calipso.c                            |  12 +-
 net/ipv6/ip6_input.c                          |   2 +-
 net/ipv6/ip6_offload.c                        |   7 +-
 net/ipv6/output_core.c                        |   7 +-
 net/netfilter/ipvs/ip_vs_xmit.c               |   2 +-
 net/netfilter/nf_conntrack_ovs.c              |   2 +-
 net/netfilter/nf_log_syslog.c                 |   2 +-
 net/netlabel/netlabel_kapi.c                  |  24 ++--
 net/netlabel/netlabel_unlabeled.c             |  32 ++---
 net/sched/sch_cake.c                          |   2 +-
 security/selinux/netlabel.c                   |   5 +-
 security/smack/smack_lsm.c                    |  14 +-
 .../selftests/bpf/prog_tests/sock_destroy.c   | 121 ++++++++++++++++++
 .../selftests/bpf/progs/sock_destroy_prog.c   |  30 +++++
 27 files changed, 316 insertions(+), 108 deletions(-)

-- 
2.56.1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

             reply	other threads:[~2026-12-01 15:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 12:10 Eva Kurchatova [this message]
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 01/15] ms/tcp: clear sock_ops cb flags before force-closing a child socket Eva Kurchatova
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 02/15] ms/tcp: Skip cond_resched() in inet_csk_listen_stop() under BPF context Eva Kurchatova
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 03/15] ms/net/ipv6: Introduce payload_len helpers Eva Kurchatova
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 04/15] ms/calipso: keep BIG TCP payload_len in calipso_skbuff_setattr() Eva Kurchatova
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 05/15] ms/calipso: hash the cache key, not the option start, in calipso_cache_add() Eva Kurchatova
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 06/15] ms/calipso: update payload_len when removing the CALIPSO option Eva Kurchatova
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 07/15] ms/tcp: fix NULL pointer dereference when restarting a Fast Open listener Eva Kurchatova
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 08/15] ms/tcp: purge Fast Open RST queue when listen() fails Eva Kurchatova
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 09/15] ms/netlabel: fix IPv6 unlabeled address add error handling Eva Kurchatova
2026-12-01 15:42   ` no-reply
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 10/15] ms/netlabel: validate unlabeled address and mask attribute lengths Eva Kurchatova
2026-12-01 15:42   ` no-reply
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 11/15] ms/bpf: Fix out-of-bounds read of sk_protocol in bpf_sock_destroy() Eva Kurchatova
2026-12-01 15:43   ` no-reply
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 12/15] ms/selftests/bpf: Test bpf_sock_destroy() on TIME_WAIT and listener socks Eva Kurchatova
2026-12-01 15:43   ` no-reply
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 13/15] ms/tcp: initialize send sequence numbers before deferring TFO Eva Kurchatova
2026-12-01 15:44   ` no-reply
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 14/15] ms/cipso: fix optlen corruption in cipso_v4_delopt() Eva Kurchatova
2026-12-01 15:45   ` no-reply
2026-12-01 12:10 ` [Devel] [PATCH hci-8.2 v2 15/15] ms/cipso: stop modifying live ip_options_rcu Eva Kurchatova
2026-12-01 15:45   ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201153749.2872789-1-eva.kurchatova@virtuozzo.com \
    --to=eva.kurchatova@virtuozzo.com \
    --cc=devel@openvz.org \
    --cc=khorenko@virtuozzo.com \
    --cc=vladimir.riabchun@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox