# CVE-2023-52637: can: j1939: Fix UAF in j1939\_sk\_match\_filter during setsockopt(SO\_J1939\_FILTER)

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-04-03T14:54:40.262Z
- **Modified:** 2026-08-05T09:10:50.061Z

## Who should check

- Anyone running Linux \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 08de58abedf6e69396e1207e4f99ef8904b2b532; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 978e50ef8c38dc71bd14d1b0143d554ff5d188ba; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 41ccb5bcbf03f02d820bc6ea8390811859f558f8; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 4dd684d4bb3cd5454e0bf6e2a1bdfbd5c9c872ed; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< f84e7534457dcd7835be743517c35378bb4e7c50; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< fc74b9cb789cae061bbca7b203a3842e059f6b5d; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< efe7cf828039aedb297c1f9920b638fffee6aabc
- Anyone running Linux 5.4

## Description

In the Linux kernel, the following vulnerability has been resolved:

can: j1939: Fix UAF in j1939\_sk\_match\_filter during setsockopt(SO\_J1939\_FILTER)

Lock jsk-\>sk to prevent UAF when setsockopt(..., SO\_J1939\_FILTER, ...)
modifies jsk-\>filters while receiving packets.

Following trace was seen on affected system:
 ==================================================================
 BUG: KASAN: slab-use-after-free in j1939\_sk\_recv\_match\_one+0x1af/0x2d0 \[can\_j1939\]
 Read of size 4 at addr ffff888012144014 by task j1939/350

 CPU: 0 PID: 350 Comm: j1939 Tainted: G        W  OE      6.5.0-rc5 \#1
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014
 Call Trace:
  print\_report+0xd3/0x620
  ? kasan\_complete\_mode\_report\_info+0x7d/0x200
  ? j1939\_sk\_recv\_match\_one+0x1af/0x2d0 \[can\_j1939\]
  kasan\_report+0xc2/0x100
  ? j1939\_sk\_recv\_match\_one+0x1af/0x2d0 \[can\_j1939\]
  \_\_asan\_load4+0x84/0xb0
  j1939\_sk\_recv\_match\_one+0x1af/0x2d0 \[can\_j1939\]
  j1939\_sk\_recv+0x20b/0x320 \[can\_j1939\]
  ? \_\_kasan\_check\_write+0x18/0x20
  ? \_\_pfx\_j1939\_sk\_recv+0x10/0x10 \[can\_j1939\]
  ? j1939\_simple\_recv+0x69/0x280 \[can\_j1939\]
  ? j1939\_ac\_recv+0x5e/0x310 \[can\_j1939\]
  j1939\_can\_recv+0x43f/0x580 \[can\_j1939\]
  ? \_\_pfx\_j1939\_can\_recv+0x10/0x10 \[can\_j1939\]
  ? raw\_rcv+0x42/0x3c0 \[can\_raw\]
  ? \_\_pfx\_j1939\_can\_recv+0x10/0x10 \[can\_j1939\]
  can\_rcv\_filter+0x11f/0x350 \[can\]
  can\_receive+0x12f/0x190 \[can\]
  ? \_\_pfx\_can\_rcv+0x10/0x10 \[can\]
  can\_rcv+0xdd/0x130 \[can\]
  ? \_\_pfx\_can\_rcv+0x10/0x10 \[can\]
  \_\_netif\_receive\_skb\_one\_core+0x13d/0x150
  ? \_\_pfx\_\_\_netif\_receive\_skb\_one\_core+0x10/0x10
  ? \_\_kasan\_check\_write+0x18/0x20
  ? \_raw\_spin\_lock\_irq+0x8c/0xe0
  \_\_netif\_receive\_skb+0x23/0xb0
  process\_backlog+0x107/0x260
  \_\_napi\_poll+0x69/0x310
  net\_rx\_action+0x2a1/0x580
  ? \_\_pfx\_net\_rx\_action+0x10/0x10
  ? \_\_pfx\_\_raw\_spin\_lock+0x10/0x10
  ? handle\_irq\_event+0x7d/0xa0
  \_\_do\_softirq+0xf3/0x3f8
  do\_softirq+0x53/0x80
  \</IRQ\>
  \<TASK\>
  \_\_local\_bh\_enable\_ip+0x6e/0x70
  netif\_rx+0x16b/0x180
  can\_send+0x32b/0x520 \[can\]
  ? \_\_pfx\_can\_send+0x10/0x10 \[can\]
  ? \_\_check\_object\_size+0x299/0x410
  raw\_sendmsg+0x572/0x6d0 \[can\_raw\]
  ? \_\_pfx\_raw\_sendmsg+0x10/0x10 \[can\_raw\]
  ? apparmor\_socket\_sendmsg+0x2f/0x40
  ? \_\_pfx\_raw\_sendmsg+0x10/0x10 \[can\_raw\]
  sock\_sendmsg+0xef/0x100
  sock\_write\_iter+0x162/0x220
  ? \_\_pfx\_sock\_write\_iter+0x10/0x10
  ? \_\_rtnl\_unlock+0x47/0x80
  ? security\_file\_permission+0x54/0x320
  vfs\_write+0x6ba/0x750
  ? \_\_pfx\_vfs\_write+0x10/0x10
  ? \_\_fget\_light+0x1ca/0x1f0
  ? \_\_rcu\_read\_unlock+0x5b/0x280
  ksys\_write+0x143/0x170
  ? \_\_pfx\_ksys\_write+0x10/0x10
  ? \_\_kasan\_check\_read+0x15/0x20
  ? fpregs\_assert\_state\_consistent+0x62/0x70
  \_\_x64\_sys\_write+0x47/0x60
  do\_syscall\_64+0x60/0x90
  ? do\_syscall\_64+0x6d/0x90
  ? irqentry\_exit+0x3f/0x50
  ? exc\_page\_fault+0x79/0xf0
  entry\_SYSCALL\_64\_after\_hwframe+0x6e/0xd8

 Allocated by task 348:
  kasan\_save\_stack+0x2a/0x50
  kasan\_set\_track+0x29/0x40
  kasan\_save\_alloc\_info+0x1f/0x30
  \_\_kasan\_kmalloc+0xb5/0xc0
  \_\_kmalloc\_node\_track\_caller+0x67/0x160
  j1939\_sk\_setsockopt+0x284/0x450 \[can\_j1939\]
  \_\_sys\_setsockopt+0x15c/0x2f0
  \_\_x64\_sys\_setsockopt+0x6b/0x80
  do\_syscall\_64+0x60/0x90
  entry\_SYSCALL\_64\_after\_hwframe+0x6e/0xd8

 Freed by task 349:
  kasan\_save\_stack+0x2a/0x50
  kasan\_set\_track+0x29/0x40
  kasan\_save\_free\_info+0x2f/0x50
  \_\_kasan\_slab\_free+0x12e/0x1c0
  \_\_kmem\_cache\_free+0x1b9/0x380
  kfree+0x7a/0x120
  j1939\_sk\_setsockopt+0x3b2/0x450 \[can\_j1939\]
  \_\_sys\_setsockopt+0x15c/0x2f0
  \_\_x64\_sys\_setsockopt+0x6b/0x80
  do\_syscall\_64+0x60/0x90
  entry\_SYSCALL\_64\_after\_hwframe+0x6e/0xd8

## Affected and fixed versions

- Linux: \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 08de58abedf6e69396e1207e4f99ef8904b2b532; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 978e50ef8c38dc71bd14d1b0143d554ff5d188ba; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 41ccb5bcbf03f02d820bc6ea8390811859f558f8; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 4dd684d4bb3cd5454e0bf6e2a1bdfbd5c9c872ed; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< f84e7534457dcd7835be743517c35378bb4e7c50; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< fc74b9cb789cae061bbca7b203a3842e059f6b5d; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< efe7cf828039aedb297c1f9920b638fffee6aabc (cvelist)
- Linux: 5.4 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-52637. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-52637.md
Affected: Linux >= 9d71dd0c70099914fcd063135da3c580865e924c, < 08de58abedf6e69396e1207e4f99ef8904b2b532; >= 9d71dd0c70099914fcd063135da3c580865e924c, < 978e50ef8c38dc71bd14d1b0143d554ff5d188ba; >= 9d71dd0c70099914fcd063135da3c580865e924c, < 41ccb5bcbf03f02d820bc6ea8390811859f558f8; >= 9d71dd0c70099914fcd0631…
Fixed in: Linux 08de58abedf6e69396e1207e4f99ef8904b2b532, Linux 978e50ef8c38dc71bd14d1b0143d554ff5d188ba, Linux 41ccb5bcbf03f02d820bc6ea8390811859f558f8, Linux 4dd684d4bb3cd5454e0bf6e2a1bdfbd5c9c872ed

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-52637 being exploited?

There is no confirmed exploitation: CVE-2023-52637 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.32% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-52637?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-52637?

Linux \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 08de58abedf6e69396e1207e4f99ef8904b2b532; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 978e50ef8c38dc71bd14d1b0143d554ff5d188ba; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 41ccb5bcbf03f02d820bc6ea8390811859f558f8; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< 4dd684d4bb3cd5454e0bf6e2a1bdfbd5c9c872ed; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< f84e7534457dcd7835be743517c35378bb4e7c50; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< fc74b9cb789cae061bbca7b203a3842e059f6b5d; \>= 9d71dd0c70099914fcd063135da3c580865e924c, \< efe7cf828039aedb297c1f9920b638fffee6aabc; Linux 5.4.

### Is there a fix for CVE-2023-52637?

Yes. Fixed in Linux 08de58abedf6e69396e1207e4f99ef8904b2b532, Linux 978e50ef8c38dc71bd14d1b0143d554ff5d188ba, Linux 41ccb5bcbf03f02d820bc6ea8390811859f558f8, Linux 4dd684d4bb3cd5454e0bf6e2a1bdfbd5c9c872ed. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-52637?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/08de58abedf6e69396e1207e4f99ef8904b2b532>
- patch: <https://git.kernel.org/stable/c/978e50ef8c38dc71bd14d1b0143d554ff5d188ba>
- patch: <https://git.kernel.org/stable/c/41ccb5bcbf03f02d820bc6ea8390811859f558f8>
- patch: <https://git.kernel.org/stable/c/4dd684d4bb3cd5454e0bf6e2a1bdfbd5c9c872ed>
- patch: <https://git.kernel.org/stable/c/f84e7534457dcd7835be743517c35378bb4e7c50>
- patch: <https://git.kernel.org/stable/c/fc74b9cb789cae061bbca7b203a3842e059f6b5d>
- patch: <https://git.kernel.org/stable/c/efe7cf828039aedb297c1f9920b638fffee6aabc>
- other: <https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-52637>

HTML: <https://flawdb.com/CVE-2023-52637> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-52637>
