HIGH Introduced in 4.18
tls RecordFrag OOB
CVE-2026-80852
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: tls: device: fix out-of-bounds write in tls_append_frag() Found with syzkaller and a local syzbot instance running on top of a netdevsim TLS offload emulation; tls_device.c is otherwise only reachable on a machine with a NIC that implements the offload. tls_push_data() only checks whether the open record still has room for another frag at the bottom of its loop, and the MSG_MORE early break skips that check. The record survives to the next syscall with the frag count it already had, and tls_append_frag() does not check either, so with TLS_TX_ZEROCOPY_RO every splice(SPLICE_F_MORE) of a byte or two adds a non-coalescing pipe page and num_frags walks off the end of tls_record_info.frags[MAX_SKB_FRAGS]. Once the record is pushed, tls_push_record() runs the same index over sg_tx_data[MAX_SKB_FRAGS] and the sg_set_page() writes land on the destruct_work that follows it, which the workqueue then calls. The byte limit is fine because copy drops to 0 and the loop falls through to the same check; the frag count has no such feedback. Push the record rather than keep a full one open, which is what a plain TCP socket does - tcp_sendmsg_locked() uses tcp_mark_push() and new_segment in both the copy and the MSG_SPLICE_PAGES paths, and tls_sw already sets full_record when the sk_msg ring fills up, MSG_MORE or not. BUG: KASAN: slab-out-of-bounds in tls_append_frag ( net/tls/tls_device.c:269) Write of size 8 at addr ffff8881104d1530 by task tls_oob/450 CPU: 2 UID: 0 PID: 450 Comm: tls_oob Not tainted 7.2.0-rc7+ #329 PREEMPT Call Trace: <TASK> dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120) print_report (mm/kasan/report.c:378 mm/kasan/report.c:482) kasan_report (mm/kasan/report.c:595) tls_append_frag (net/tls/tls_device.c:269) tls_push_data (net/tls/tls_device.c:518) tls_device_sendmsg (net/tls/tls_device.c:583) inet_sendmsg (net/ipv4/af_inet.c:865) sock_sendmsg (net/socket.c:775 net/socket.c:790 net/socket.c:813) splice_to_socket (fs/splice.c:884) do_splice (fs/splice.c:936 fs/splice.c:1349) __do_splice (fs/splice.c:1431) __x64_sys_splice (fs/splice.c:1634 fs/splice.c:1616) do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) </TASK> and, once the record is pushed: UBSAN: array-index-out-of-bounds in net/tls/tls_device.c:300:24 index 18 is out of range for type 'skb_frag_t [17]' UBSAN: array-index-out-of-bounds in net/tls/tls_device.c:301:41 index 18 is out of range for type 'scatterlist [17]' UBSAN: array-index-out-of-bounds in net/tls/tls_device.c:302:39 index 18 is out of range for type 'scatterlist [17]' UBSAN: array-index-out-of-bounds in net/tls/tls_device.c:307:38 index 26 is out of range for type 'scatterlist [17]' kernel tried to execute NX-protected page - exploit attempt? (uid: 0) BUG: unable to handle page fault for address: ffffea000411a680 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0011) - permissions violation Oops: Oops: 0011 [#1] SMP KASAN PTI Workqueue: ktls_device_destruct 0xffffea000411a680 RIP: 0010:0xffffea000411a680 Call Trace: <TASK> worker_thread (kernel/workqueue.c:3405 kernel/workqueue.c:3486) kthread (kernel/kthread.c:436) ret_from_fork (arch/x86/kernel/process.c:158) ret_from_fork_asm (arch/x86/entry/entry_64.S:245) </TASK>
02KernelScan AI Analysis
Risk summary
A local user can trigger an out-of-bounds write in the kernel TLS device offload transmit path by repeatedly splicing tiny amounts of data with MSG_MORE on a TLS socket. The overflow corrupts kernel heap memory adjacent to the fragment array, including a workqueue structure that the kernel later executes, potentially leading to arbitrary code execution or a kernel panic. This requires a NIC with TLS offload support (or netdevsim configured by an administrator).
Vulnerability analysis
When a process streams data into a kernel TLS socket with device offload in small pieces, each operation adds a new fragment to the current TLS record. The code checks whether the record is full only at the end of its processing loop, but the path taken when the caller indicates more data is coming skips that check entirely. As a result, across multiple system calls the fragment count exceeds the fixed-size array, and out-of-bounds writes corrupt adjacent kernel memory—including a background-work structure that the kernel later tries to run, which can redirect execution to an attacker-controlled address. The fix closes and pushes the record when it becomes full even if more data is expected, matching how plain TCP and the software TLS path behave, so a full record is never left open for additional fragments. The vulnerability is reachable by any local process that can create and use a TLS socket on a system whose network device implements TLS offload; no special privileges are needed for the triggering operation itself, though the hardware offload capability must be present.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.1 | 4.18 | 6.1.187 | 03ced5da6120 |
| 6.12 | 4.18 | 6.12.108 | b7f10d4ff987 |
| 6.18 | 4.18 | 6.18.49 | fadbc1ed2a87 |
| 6.6 | 4.18 | 6.6.156 | a832d7cb09da |
| 7.1 | 4.18 | 7.1.13 | cd7e875b8959 |
| 7.2 | 4.18 | 7.2.3 | 7e1208c13561 |
| mainline | 4.18 | 7.3 | b17cf742eaad |
| cip/6.1 | 4.18 | 6.1.187-cip60 | 03ced5da6120 |
| cip/6.1-rt | 4.18 | 6.1.189-cip61-rt32 | 03ced5da6120 |
| cip/6.12 | 4.18 | 6.12.108-cip31 | b7f10d4ff987 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.108-cip31 |
| cip/6.1 | Fixed in 6.1.187-cip60 |
| cip/6.1-rt | Fixed in 6.1.189-cip61-rt32 |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.271-cip78) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.268-cip77-rt34) |
| cip/4.19 | Affected — no CIP fix yet (latest 4.19.325-cip136) |
| cip/4.19-rt | Affected — no CIP fix yet (latest 4.19.325-cip136-rt50) |