{"id":"CVE-2025-38542","state":"PUBLISHED","title":"net: appletalk: Fix device refcount leak in atrtr_create()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: appletalk: Fix device refcount leak in atrtr_create()\n\nWhen updating an existing route entry in atrtr_create(), the old device\nreference was not being released before assigning the new device,\nleading to a device refcount leak. Fix this by calling dev_put() to\nrelease the old device reference before holding the new one.","publishedAt":"2025-08-16T11:22:16.689Z","updatedAt":"2026-08-05T12:02:46.709Z","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":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"b92bedf71f25303e203a4e657489d76691a58119","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"a7852b01793669248dce0348d14df89e77a32afd","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"b2f5dfa87367fdce9f8b995bc6c38f64f9ea2c90","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"d2e9f50f0bdad73b64a871f25186b899624518c4","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"4a17370da6e476d3d275534e9e9cd2d02c57ca46","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"473f3eadfc73b0fb6d8dee5829d19a5772e387f7","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"64124cf0aab0dd1e18c0fb5ae66e45741e727f8b","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"711c80f7d8b163d3ecd463cd96f07230f488e750","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/appletalk/ddp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.12","versionType":"semver"},{"version":"5.4.296","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.240","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.189","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.146","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.99","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.39","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.7","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/appletalk/ddp.c"]}],"references":["https://git.kernel.org/stable/c/b92bedf71f25303e203a4e657489d76691a58119","https://git.kernel.org/stable/c/a7852b01793669248dce0348d14df89e77a32afd","https://git.kernel.org/stable/c/b2f5dfa87367fdce9f8b995bc6c38f64f9ea2c90","https://git.kernel.org/stable/c/d2e9f50f0bdad73b64a871f25186b899624518c4","https://git.kernel.org/stable/c/4a17370da6e476d3d275534e9e9cd2d02c57ca46","https://git.kernel.org/stable/c/473f3eadfc73b0fb6d8dee5829d19a5772e387f7","https://git.kernel.org/stable/c/64124cf0aab0dd1e18c0fb5ae66e45741e727f8b","https://git.kernel.org/stable/c/711c80f7d8b163d3ecd463cd96f07230f488e750","https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/38xxx/CVE-2025-38542.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-38542","state":"PUBLISHED","datePublished":"2025-08-16T11:22:16.689Z","dateUpdated":"2026-08-05T12:02:46.709Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T04:51:24.024Z"},"containers":{"cna":{"title":"net: appletalk: Fix device refcount leak in atrtr_create()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: appletalk: Fix device refcount leak in atrtr_create()\n\nWhen updating an existing route entry in atrtr_create(), the old device\nreference was not being released before assigning the new device,\nleading to a device refcount leak. Fix this by calling dev_put() to\nrelease the old device reference before holding the new one."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"b92bedf71f25303e203a4e657489d76691a58119","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"a7852b01793669248dce0348d14df89e77a32afd","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"b2f5dfa87367fdce9f8b995bc6c38f64f9ea2c90","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"d2e9f50f0bdad73b64a871f25186b899624518c4","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"4a17370da6e476d3d275534e9e9cd2d02c57ca46","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"473f3eadfc73b0fb6d8dee5829d19a5772e387f7","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"64124cf0aab0dd1e18c0fb5ae66e45741e727f8b","versionType":"git"},{"version":"c7f905f0f6d49ed8c1aa4566c31f0383a0ba0c9d","status":"affected","lessThan":"711c80f7d8b163d3ecd463cd96f07230f488e750","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/appletalk/ddp.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.12","versionType":"semver"},{"version":"5.4.296","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.240","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.189","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.146","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.99","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.39","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.7","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/appletalk/ddp.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/b92bedf71f25303e203a4e657489d76691a58119"},{"url":"https://git.kernel.org/stable/c/a7852b01793669248dce0348d14df89e77a32afd"},{"url":"https://git.kernel.org/stable/c/b2f5dfa87367fdce9f8b995bc6c38f64f9ea2c90"},{"url":"https://git.kernel.org/stable/c/d2e9f50f0bdad73b64a871f25186b899624518c4"},{"url":"https://git.kernel.org/stable/c/4a17370da6e476d3d275534e9e9cd2d02c57ca46"},{"url":"https://git.kernel.org/stable/c/473f3eadfc73b0fb6d8dee5829d19a5772e387f7"},{"url":"https://git.kernel.org/stable/c/64124cf0aab0dd1e18c0fb5ae66e45741e727f8b"},{"url":"https://git.kernel.org/stable/c/711c80f7d8b163d3ecd463cd96f07230f488e750"}],"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 vulnerability is reached via `ioctl(SIOCADDRT)` on a locally-created `AF_APPLETALK` socket, requiring local system access. There is no remote or adjacent-network trigger for `atrtr_create()`.\nAC:L - The leak is fully deterministic — issuing the same `SIOCADDRT` twice for one route target/flags pair leaks a reference on every subsequent call, with no race, timing window, or memory-layout dependency. The attacker controls the loop entirely and `appletalk.ko` autoloads on demand.\nPR:L - The 32-bit compat path `atalk_compat_routing_ioctl()` reaches `atrtr_create()` with no capability check whatsoever (dropped in v5.6 by dc13c8761c91c0), and `compat_sock_ioctl()` dispatches to it before any generic gating, so an ordinary unprivileged user account suffices. Only the native path enforces `capable(CAP_NET_ADMIN)`.\nUI:N - The attacker triggers the entire sequence from their own process with socket creation and repeated ioctls. No victim action or cooperation is involved.\nS:U - The leaked reference, the resulting hang, and any subsequent memory corruption are all confined to the kernel's own security authority. No VM, IOMMU, or sandbox boundary is crossed.\nC:H - The netdev refcount is an unprotected wrappable `int` (`this_cpu_inc` on `pcpu_refcnt`, no `refcount_t` saturation), so sustained leaking wraps `netdev_refcnt_read()` and causes `free_netdev()` while live references remain. The resulting use-after-free on `struct net_device` — still referenced by routes, qdiscs and sockets — yields an arbitrary kernel read primitive after heap reclaim.\nI:H - The same refcount wrap produces a dangling `struct net_device`, an object dense with function-pointer tables (`netdev_ops`, `ethtool_ops`, `header_ops`) that is straightforward to reclaim and spray, giving a write and control-flow hijack primitive. Per kernel scoring guidance, use-after-free is rated High for integrity.\nA:H - Each leaked reference makes the device permanently unremovable — `netdev_wait_allrefs_any()` spins forever from `netdev_run_todo()`, wedging the single-threaded `cleanup_net` workqueue so all further netns teardown and RTNL device removal hangs system-wide until reboot. The `BUG_ON(netdev_refcnt_read(dev) != 1)` in `netdev_run_todo()` additionally gives a directly reachable kernel panic."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:02:46.709Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.4.296"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.10.240"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"5.15.189"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.1.146"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.6.99"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.12.39"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.15.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.12","versionEndExcluding":"6.16"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T17:39:38.181Z"}}]}}}