{"id":"CVE-2024-56603","state":"PUBLISHED","title":"net: af_can: do not leave a dangling sk pointer in can_create()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: af_can: do not leave a dangling sk pointer in can_create()\n\nOn error can_create() frees the allocated sk object, but sock_init_data()\nhas already attached it to the provided sock object. This will leave a\ndangling sk pointer in the sock object and may cause use-after-free later.","publishedAt":"2024-12-27T14:51:08.923Z","updatedAt":"2026-08-05T11:45:23.876Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/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":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"884ae8bcee749be43a071d6ed2d89058dbd2425c","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"ce39b5576785bb3e66591145aad03d66bc3e778d","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"1fe625f12d090d69f3f084990c7e4c1ff94bfe5f","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"5947c9ac08f0771ea8ed64186b0d52e9029cb6c0","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"db207d19adbac96058685f6257720906ad41d215","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"8df832e6b945e1ba61467d7f1c9305e314ae92fe","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"811a7ca7320c062e15d0f5b171fe6ad8592d1434","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/can/af_can.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.25","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.25","versionType":"semver"},{"version":"5.4.287","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.231","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.174","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.120","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.66","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.5","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.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/af_can.c"]}],"references":["https://git.kernel.org/stable/c/884ae8bcee749be43a071d6ed2d89058dbd2425c","https://git.kernel.org/stable/c/ce39b5576785bb3e66591145aad03d66bc3e778d","https://git.kernel.org/stable/c/1fe625f12d090d69f3f084990c7e4c1ff94bfe5f","https://git.kernel.org/stable/c/5947c9ac08f0771ea8ed64186b0d52e9029cb6c0","https://git.kernel.org/stable/c/db207d19adbac96058685f6257720906ad41d215","https://git.kernel.org/stable/c/8df832e6b945e1ba61467d7f1c9305e314ae92fe","https://git.kernel.org/stable/c/811a7ca7320c062e15d0f5b171fe6ad8592d1434","https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html","https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:08:12.933Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/56xxx/CVE-2024-56603.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-56603","state":"PUBLISHED","datePublished":"2024-12-27T14:51:08.923Z","dateUpdated":"2026-08-05T11:45:23.876Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-27T14:03:06.012Z"},"containers":{"cna":{"title":"net: af_can: do not leave a dangling sk pointer in can_create()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: af_can: do not leave a dangling sk pointer in can_create()\n\nOn error can_create() frees the allocated sk object, but sock_init_data()\nhas already attached it to the provided sock object. This will leave a\ndangling sk pointer in the sock object and may cause use-after-free later."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"884ae8bcee749be43a071d6ed2d89058dbd2425c","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"ce39b5576785bb3e66591145aad03d66bc3e778d","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"1fe625f12d090d69f3f084990c7e4c1ff94bfe5f","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"5947c9ac08f0771ea8ed64186b0d52e9029cb6c0","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"db207d19adbac96058685f6257720906ad41d215","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"8df832e6b945e1ba61467d7f1c9305e314ae92fe","versionType":"git"},{"version":"0d66548a10cbbe0ef256852d63d30603f0f73f9b","status":"affected","lessThan":"811a7ca7320c062e15d0f5b171fe6ad8592d1434","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/can/af_can.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.25","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.25","versionType":"semver"},{"version":"5.4.287","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.231","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.174","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.120","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.66","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.5","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.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/af_can.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/884ae8bcee749be43a071d6ed2d89058dbd2425c"},{"url":"https://git.kernel.org/stable/c/ce39b5576785bb3e66591145aad03d66bc3e778d"},{"url":"https://git.kernel.org/stable/c/1fe625f12d090d69f3f084990c7e4c1ff94bfe5f"},{"url":"https://git.kernel.org/stable/c/5947c9ac08f0771ea8ed64186b0d52e9029cb6c0"},{"url":"https://git.kernel.org/stable/c/db207d19adbac96058685f6257720906ad41d215"},{"url":"https://git.kernel.org/stable/c/8df832e6b945e1ba61467d7f1c9305e314ae92fe"},{"url":"https://git.kernel.org/stable/c/811a7ca7320c062e15d0f5b171fe6ad8592d1434"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The defect lives in the `socket(AF_CAN, SOCK_RAW, CAN_RAW)` creation path, reached only through a local syscall via `__sock_create()`; no CAN-bus frame or network data reaches `can_create()`. Consistent with the Bluetooth and af_packet siblings in the same series, which were also scored AV:L because the flaw is in socket setup rather than frame processing.\nAC:L - The only failing `->init` is `raw_init()`'s `alloc_percpu(struct uniqframe)` returning `-ENOMEM`, and an unprivileged local attacker can drive the percpu allocator into failure by spraying percpu-consuming objects (including CAN raw sockets themselves) before retrying `socket()` in a tight loop. This is the same attacker-induced-ENOMEM shape as the af_packet sibling CVE-2024-56606, which was scored AC:L.\nPR:L - `can_create()` performs no `capable()` check at all — unlike af_packet there is no `CAP_NET_RAW` gate — and there is no `net_eq(net, &init_net)` restriction, so any unprivileged local user, including inside an unprivileged user namespace, can reach it. Where `CONFIG_CAN` is modular, `MODULE_ALIAS_NETPROTO(PF_CAN)` lets the unprivileged `socket()` call autoload the module itself.\nUI:N - The attacker performs the entire sequence — memory pressure plus repeated `socket()` calls — from its own process. No victim action, mount, or file open is involved.\nS:U - The freed `struct raw_sock`/`struct sock` and the stale `sock->sk` reference both live entirely within the kernel's own security authority. No VM, IOMMU, or sandbox boundary is crossed.\nC:H - Per the use-after-free rubric, the stale `sock->sk` pointing at a freed `raw_sock` in the general kmalloc caches lets an attacker reclaim the slab and read back attacker-shaped or leftover kernel data; the demonstrated consumer for this exact bug class (CVE-2024-40954) is a KASAN-confirmed slab-use-after-free *read* of the freed sock via `__sock_gen_cookie()`.\nI:H - The same dangling reference permits heap spraying of the reclaimed slot, giving control over function-pointer-bearing fields of `struct sock` (`sk_prot`, `sk_destruct`, `sk_wq`) and therefore a control-flow-hijack primitive rather than mere data corruption.\nA:H - Any dereference of the freed `sock->sk` before `iput()` faults or corrupts kernel state, producing an oops or panic; the rubric treats all use-after-free conditions as high availability impact even when only partially exploited."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:45:23.876Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.25","versionEndExcluding":"5.4.287"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.25","versionEndExcluding":"5.10.231"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.25","versionEndExcluding":"5.15.174"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.25","versionEndExcluding":"6.1.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.25","versionEndExcluding":"6.6.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.25","versionEndExcluding":"6.12.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.25","versionEndExcluding":"6.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2024-56603","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-02-11T15:42:16.822268Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-02-11T15:45:23.668Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T20:50:46.640Z"}}]}}}