{"id":"CVE-2021-47232","state":"PUBLISHED","title":"can: j1939: fix Use-after-Free, hold skb ref while in use","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ncan: j1939: fix Use-after-Free, hold skb ref while in use\n\nThis patch fixes a Use-after-Free found by the syzbot.\n\nThe problem is that a skb is taken from the per-session skb queue,\nwithout incrementing the ref count. This leads to a Use-after-Free if\nthe skb is taken concurrently from the session queue due to a CTS.","publishedAt":"2024-05-21T14:19:35.084Z","updatedAt":"2026-08-05T08:46:51.007Z","severity":{"score":9.8,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"9d71dd0c70099914fcd063135da3c580865e924c","status":"affected","lessThan":"22cba878abf646cd3a02ee7c8c2cef7afe66a256","versionType":"git"},{"version":"9d71dd0c70099914fcd063135da3c580865e924c","status":"affected","lessThan":"509ab6bfdd0c76daebbad0f0af07da712116de22","versionType":"git"},{"version":"9d71dd0c70099914fcd063135da3c580865e924c","status":"affected","lessThan":"1071065eeb33d32b7d98c2ce7591881ae7381705","versionType":"git"},{"version":"9d71dd0c70099914fcd063135da3c580865e924c","status":"affected","lessThan":"2030043e616cab40f510299f09b636285e0a3678","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/can/j1939/transport.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.4","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.4","versionType":"semver"},{"version":"5.4.128","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.46","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.12.13","status":"unaffected","lessThanOrEqual":"5.12.*","versionType":"semver"},{"version":"5.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/can/j1939/transport.c"]}],"references":["https://git.kernel.org/stable/c/22cba878abf646cd3a02ee7c8c2cef7afe66a256","https://git.kernel.org/stable/c/509ab6bfdd0c76daebbad0f0af07da712116de22","https://git.kernel.org/stable/c/1071065eeb33d32b7d98c2ce7591881ae7381705","https://git.kernel.org/stable/c/2030043e616cab40f510299f09b636285e0a3678"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T19:49:19.404Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2021/47xxx/CVE-2021-47232.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2021-47232","state":"PUBLISHED","datePublished":"2024-05-21T14:19:35.084Z","dateUpdated":"2026-08-05T08:46:51.007Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-04-10T18:59:19.530Z"},"containers":{"cna":{"title":"can: j1939: fix Use-after-Free, hold skb ref while in use","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ncan: j1939: fix Use-after-Free, hold skb ref while in use\n\nThis patch fixes a Use-after-Free found by the syzbot.\n\nThe problem is that a skb is taken from the per-session skb queue,\nwithout incrementing the ref count. This leads to a Use-after-Free if\nthe skb is taken concurrently from the session queue due to a CTS."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"9d71dd0c70099914fcd063135da3c580865e924c","status":"affected","lessThan":"22cba878abf646cd3a02ee7c8c2cef7afe66a256","versionType":"git"},{"version":"9d71dd0c70099914fcd063135da3c580865e924c","status":"affected","lessThan":"509ab6bfdd0c76daebbad0f0af07da712116de22","versionType":"git"},{"version":"9d71dd0c70099914fcd063135da3c580865e924c","status":"affected","lessThan":"1071065eeb33d32b7d98c2ce7591881ae7381705","versionType":"git"},{"version":"9d71dd0c70099914fcd063135da3c580865e924c","status":"affected","lessThan":"2030043e616cab40f510299f09b636285e0a3678","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/can/j1939/transport.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.4","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.4","versionType":"semver"},{"version":"5.4.128","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.46","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.12.13","status":"unaffected","lessThanOrEqual":"5.12.*","versionType":"semver"},{"version":"5.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/can/j1939/transport.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/22cba878abf646cd3a02ee7c8c2cef7afe66a256"},{"url":"https://git.kernel.org/stable/c/509ab6bfdd0c76daebbad0f0af07da712116de22"},{"url":"https://git.kernel.org/stable/c/1071065eeb33d32b7d98c2ce7591881ae7381705"},{"url":"https://git.kernel.org/stable/c/2030043e616cab40f510299f09b636285e0a3678"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"scenarios":[{"lang":"en","value":"AV:N - The UAF is reached via can_rcv → j1939_can_recv → j1939_tp_recv when processing peer TP.CM_CTS/DAT frames; an unauthenticated J1939/CAN peer drives the race, consistent with other packet-triggered j1939 scores (e.g. CVE-2024-56645).\nAC:L - The attacker controls CTS injection timing against an active TP session and can retry indefinitely; when both sides of the race are attacker-driven (local sockets/vcan or crafted bus traffic), success does not depend on conditions outside attacker influence.\nPR:N - J1939 receive processing has no authentication; a bus peer needs no credentials on the target, and the same path is also reachable from an unprivileged AF_CAN/CAN_J1939 socket with no capability checks on create/bind/send.\nUI:N - Frames are handled in softirq with no victim action required beyond a bound J1939 socket, which is the normal steady state on systems using this stack.\nS:U - The corrupted sk_buff and resulting privilege impact remain within the kernel's security authority; this is not a VM escape, IOMMU bypass, or sandbox boundary crossing.\nC:H - Use-after-free of the session skb enables heap grooming and arbitrary read of freed object contents (including via continued use of the dangling skb pointer in TX/RX data paths).\nI:H - The same UAF yields a reclaimable freed sk_buff that can be sprayed for arbitrary write and control-flow hijacking primitives in the kernel heap.\nA:H - Dereferencing the freed skb causes kernel oops/panic, and an unauthenticated peer can trigger the race repeatedly to deny service."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:46:51.007Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.4","versionEndExcluding":"5.4.128"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.4","versionEndExcluding":"5.10.46"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.4","versionEndExcluding":"5.12.13"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.4","versionEndExcluding":"5.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","affected":[{"vendor":"linux","product":"linux_kernel","defaultStatus":"unknown","versions":[{"version":"9d71dd0c7009","status":"affected","lessThan":"22cba878abf6 ","versionType":"custom"}],"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"]},{"vendor":"linux","product":"linux_kernel","defaultStatus":"unknown","versions":[{"version":"9d71dd0c7009","status":"affected","lessThan":" 509ab6bfdd0c ","versionType":"custom"}],"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"]},{"vendor":"linux","product":"linux_kernel","defaultStatus":"unknown","versions":[{"version":"9d71dd0c7009","status":"affected","lessThan":"1071065eeb33 ","versionType":"custom"}],"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"]},{"vendor":"linux","product":"linux_kernel","defaultStatus":"unknown","versions":[{"version":"9d71dd0c7009","status":"affected","lessThan":"2030043e616c ","versionType":"custom"}],"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"]},{"vendor":"linux","product":"linux_kernel","defaultStatus":"unknown","versions":[{"version":"5.4.128","status":"unaffected","lessThan":"5.5","versionType":"custom"}],"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"]},{"vendor":"linux","product":"linux_kernel","defaultStatus":"unknown","versions":[{"version":" 5.10.46","status":"unaffected","lessThan":"5.11","versionType":"custom"}],"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"]},{"vendor":"linux","product":"linux_kernel","defaultStatus":"unknown","versions":[{"version":"5.12.13","status":"unaffected","lessThan":"5.13","versionType":"custom"}],"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"]},{"vendor":"linux","product":"linux_kernel","defaultStatus":"unknown","versions":[{"version":"5.13","status":"unaffected"}],"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"]},{"vendor":"linux","product":"linux_kernel","defaultStatus":"unknown","versions":[{"version":"0","status":"unaffected","lessThan":"5.4","versionType":"custom"}],"cpes":["cpe:2.3:o:linux:linux_kernel:-:*:*:*:*:*:*:*"]},{"vendor":"linux","product":"linux_kernel","defaultStatus":"unknown","versions":[{"version":"5.4","status":"affected"}],"cpes":["cpe:2.3:o:linux:linux_kernel:5.4:-:*:*:*:*:*:*"]}],"metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":8.4,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"NONE","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"timestamp":"2024-05-28T19:03:26.982947Z","id":"CVE-2021-47232","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","type":"CWE","lang":"en","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-06-06T19:57:24.908Z"}},{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/22cba878abf646cd3a02ee7c8c2cef7afe66a256","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/509ab6bfdd0c76daebbad0f0af07da712116de22","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/1071065eeb33d32b7d98c2ce7591881ae7381705","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/2030043e616cab40f510299f09b636285e0a3678","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-04T05:32:07.907Z"}}]}}}