# CVE-2023-52523: linux: In the Linux kernel, the following vulnerability has been resolved:  bpf, sockmap: Reject sk_msg egress redirects to...

CVE-2023-52523 is fixed in 21 products on 1 platform, first by ALAS2023-2023-422, released October 30, 2023. It is not reported as exploited. Patch Radar priority: Routine.

- Web page: https://patchblox.com/security/cve/CVE-2023-52523
- Priority: Routine
- CVSS: 5.5 (medium)
- EPSS: 0.0024
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Oct 30, 2023

## Description

In the Linux kernel, the following vulnerability has been resolved:  bpf, sockmap: Reject sk_msg egress redirects to non-TCP sockets  With a SOCKMAP/SOCKHASH map and an sk_msg program user can steer messages sent from one TCP socket (s1) to actually egress from another TCP socket (s2):  tcp_bpf_sendmsg(s1)		// = sk_prot->sendmsg   tcp_bpf_send_verdict(s1)	// __SK_REDIRECT case     tcp_bpf_sendmsg_redir(s2)       tcp_bpf_push_locked(s2) 	tcp_bpf_push(s2) 	  tcp_rate_check_app_limited(s2) // expects tcp_sock 	  tcp_sendmsg_locked(s2)	 // ditto  There is a hard-coded assumption in the call-chain, that the egress socket (s2) is a TCP socket.  However in commit 122e6c79efe1 ("sock_map: Update sock type checks for UDP") we have enabled redirects to non-TCP sockets. This was done for the sake of BPF sk_skb programs. There was no indention to support sk_msg send-to-egress use case.  As a result, attempts to send-to-egress through a non-TCP socket lead to a crash due to invalid downcast from sock to tcp_sock:   BUG: kernel NULL pointer dereference, address: 000000000000002f  ...  Call Trace:   <TASK>   ? show_regs+0x60/0x70   ? __die+0x1f/0x70   ? page_fault_oops+0x80/0x160   ? do_user_addr_fault+0x2d7/0x800   ? rcu_is_watching+0x11/0x50   ? exc_page_fault+0x70/0x1c0   ? asm_exc_page_fault+0x27/0x30   ? tcp_tso_segs+0x14/0xa0   tcp_write_xmit+0x67/0xce0   __tcp_push_pending_frames+0x32/0xf0   tcp_push+0x107/0x140   tcp_sendmsg_locked+0x99f/0xbb0   tcp_bpf_push+0x19d/0x3a0   tcp_bpf_sendmsg_redir+0x55/0xd0   tcp_bpf_send_verdict+0x407/0x550   tcp_bpf_sendmsg+0x1a1/0x390   inet_sendmsg+0x6a/0x70   sock_sendmsg+0x9d/0xc0   ? sockfd_lookup_light+0x12/0x80   __sys_sendto+0x10e/0x160   ? syscall_enter_from_user_mode+0x20/0x60   ? __this_cpu_preempt_check+0x13/0x20   ? lockdep_hardirqs_on+0x82/0x110   __x64_sys_sendto+0x1f/0x30   do_syscall_64+0x38/0x90   entry_SYSCALL_64_after_hwframe+0x63/0xcd  Reject selecting a non-TCP sockets as redirect target from a BPF sk_msg program to prevent the crash. When attempted, user will receive an EACCES error from send/sendto/sendmsg() syscall.

## Where it's fixed

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Linux | bpftool amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | bpftool-debuginfo amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-debuginfo amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-debuginfo-common-aarch64 amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-debuginfo-common-x86_64 amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-devel amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-headers amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-libbpf amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-libbpf-devel amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-libbpf-static amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-livepatch-6.1.59-84.139 amzn 2023 | 1.0-0.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-modules-extra amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-tools amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-tools-debuginfo amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | kernel-tools-devel amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | linux Debian 12.15 (bookworm) | 6.1.64-1 | [DEBIAN-CVE-2023-52523](https://patchblox.com/security/data/fix/linux/debian-cve-2023-52523.md) | Mar 2, 2024 |
| Linux | linux Debian 13.5 (trixie) | 6.5.8-1 | [DEBIAN-CVE-2023-52523](https://patchblox.com/security/data/fix/linux/debian-cve-2023-52523.md) | Mar 2, 2024 |
| Linux | linux Debian 14 | 6.5.8-1 | [DEBIAN-CVE-2023-52523](https://patchblox.com/security/data/fix/linux/debian-cve-2023-52523.md) | Mar 2, 2024 |
| Linux | perf amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | perf-debuginfo amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | python3-perf amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |
| Linux | python3-perf-debuginfo amzn 2023 | 6.1.59-84.139.amzn2023 | [ALAS2023-2023-422](https://patchblox.com/security/data/fix/linux/alas2023-2023-422.md) | Oct 30, 2023 |

---

Data as of 2026-11-09T07:25:28Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.
