{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-39787","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2025-04-16T07:20:57.131Z","datePublished":"2025-09-11T16:56:36.426Z","dateUpdated":"2026-08-05T12:05:08.647Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T12:05:08.647Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nsoc: qcom: mdt_loader: Ensure we don't read past the ELF header\n\nWhen the MDT loader is used in remoteproc, the ELF header is sanitized\nbeforehand, but that's not necessary the case for other clients.\n\nValidate the size of the firmware buffer to ensure that we don't read\npast the end as we iterate over the header. e_phentsize and e_shentsize\nare validated as well, to ensure that the assumptions about step size in\nthe traversal are valid."}],"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 malformed MDT/ELF image is consumed from the local filesystem via request_firmware(), and the parse is driven by local device activity (V4L2/DRM open, remoteproc start, driver probe) — there is no remote or adjacent-network input path into qcom_mdt_loader.\nAC:L - Triggering is fully deterministic — a truncated file or an ELF header with a large e_phnum immediately walks program headers off the end of the vmalloc'd firmware buffer, with no race, timing window, or memory-layout condition outside the attacker's control.\nPR:L - An unprivileged local user can repeatedly drive the vulnerable parse (opening /dev/video* runtime-resumes venus/iris and reloads the firmware; opening the DRM render node resumes the GPU and reloads the zap shader), and no capability check guards qcom_mdt_get_size()/qcom_mdt_load(); firmware image placement on many embedded/Android/IoT Qualcomm deployments is not protected by init-namespace root alone.\nUI:N - Firmware loading happens automatically on device probe and on runtime-PM resume, so no victim action is needed — the attacker triggers the load themselves.\nS:U - The out-of-bounds accesses and any resulting corruption remain within the kernel's own security authority; no hypervisor, IOMMU, or sandbox boundary is crossed by the defect itself.\nC:H - The traversal reads up to ~2 MB of adjacent kernel memory past the firmware buffer, and qcom_mdt_read_metadata() will memcpy an out-of-bounds-derived length of kernel memory into a blob passed to qcom_scm_pas_init_image() and into the co-processor carveout — an unbounded kernel memory disclosure, not a few-byte bounded read.\nI:H - Out-of-bounds program-header values become control data for the memcpy()/memset() into the remote-processor memory region and for the PAS metadata, and on 32-bit Qualcomm targets the uncontrolled ehdr_size + hash_size sum can wrap so that a small kmalloc() is followed by a huge memcpy(), yielding a heap out-of-bounds write.\nA:H - The firmware buffer lives in vmalloc/vmap space with guard pages, so a multi-megabyte overread reliably faults and panics the kernel; the same path also feeds bogus sizes into memremap() and TrustZone calls, wedging the GPU/DSP/modem subsystem."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/soc/qcom/mdt_loader.c"],"versions":[{"version":"2aad40d911eeb7dcac91c669f2762a28134f0eb1","lessThan":"1096eb63ecfc8df90b70cd068e6de0c2ff204dfd","status":"affected","versionType":"git"},{"version":"2aad40d911eeb7dcac91c669f2762a28134f0eb1","lessThan":"e1720eb32acf411c328af6a8c8f556c94535808e","status":"affected","versionType":"git"},{"version":"2aad40d911eeb7dcac91c669f2762a28134f0eb1","lessThan":"0d59ce2bfc3bb13abe6240335a1bf7b96536d022","status":"affected","versionType":"git"},{"version":"2aad40d911eeb7dcac91c669f2762a28134f0eb1","lessThan":"43d26997d88c4056fce0324e72f62556bc7e8e8d","status":"affected","versionType":"git"},{"version":"2aad40d911eeb7dcac91c669f2762a28134f0eb1","lessThan":"981c845f29838e468a9bfa87f784307193a31297","status":"affected","versionType":"git"},{"version":"2aad40d911eeb7dcac91c669f2762a28134f0eb1","lessThan":"87bfabb3b2f46827639173f143aa43f7cfc0a7e6","status":"affected","versionType":"git"},{"version":"2aad40d911eeb7dcac91c669f2762a28134f0eb1","lessThan":"81278be4eb5f08ba2c68c3055893e61cc03727fe","status":"affected","versionType":"git"},{"version":"2aad40d911eeb7dcac91c669f2762a28134f0eb1","lessThan":"9f9967fed9d066ed3dae9372b45ffa4f6fccfeef","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/soc/qcom/mdt_loader.c"],"versions":[{"version":"4.11","status":"affected"},{"version":"0","lessThan":"4.11","status":"unaffected","versionType":"semver"},{"version":"5.4.297","lessThanOrEqual":"5.4.*","status":"unaffected","versionType":"semver"},{"version":"5.10.241","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.190","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.149","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.103","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.44","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.16.4","lessThanOrEqual":"6.16.*","status":"unaffected","versionType":"semver"},{"version":"6.17","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"5.4.297"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"5.10.241"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"5.15.190"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"6.1.149"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"6.6.103"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"6.12.44"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"6.16.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.11","versionEndExcluding":"6.17"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/1096eb63ecfc8df90b70cd068e6de0c2ff204dfd"},{"url":"https://git.kernel.org/stable/c/e1720eb32acf411c328af6a8c8f556c94535808e"},{"url":"https://git.kernel.org/stable/c/0d59ce2bfc3bb13abe6240335a1bf7b96536d022"},{"url":"https://git.kernel.org/stable/c/43d26997d88c4056fce0324e72f62556bc7e8e8d"},{"url":"https://git.kernel.org/stable/c/981c845f29838e468a9bfa87f784307193a31297"},{"url":"https://git.kernel.org/stable/c/87bfabb3b2f46827639173f143aa43f7cfc0a7e6"},{"url":"https://git.kernel.org/stable/c/81278be4eb5f08ba2c68c3055893e61cc03727fe"},{"url":"https://git.kernel.org/stable/c/9f9967fed9d066ed3dae9372b45ffa4f6fccfeef"}],"title":"soc: qcom: mdt_loader: Ensure we don't read past the ELF header","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":{"orgId":"af854a3a-2127-422b-91ae-364da2661108","shortName":"CVE","dateUpdated":"2025-11-03T17:43:21.316Z"}},{"x_adpType":"supplier","providerMetadata":{"orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","shortName":"siemens-SADP","dateUpdated":"2026-07-14T12:42:54.511Z"},"affected":[{"vendor":"Siemens","product":"SIMATIC CN 4100","versions":[{"status":"affected","version":"0","lessThan":"V5.0","versionType":"custom"}],"defaultStatus":"unknown"},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","versions":[{"status":"affected","version":"V3.1.5","lessThan":"*","versionType":"custom"}],"defaultStatus":"unknown"},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518-4 PN/DP MFP","versions":[{"status":"affected","version":"V3.1.5","lessThan":"*","versionType":"custom"}],"defaultStatus":"unknown"},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","versions":[{"status":"affected","version":"V3.1.5","lessThan":"*","versionType":"custom"}],"defaultStatus":"unknown"},{"vendor":"Siemens","product":"SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP","versions":[{"status":"affected","version":"V3.1.5","lessThan":"*","versionType":"custom"}],"defaultStatus":"unknown"},{"vendor":"Siemens","product":"SIPLUS S7-1500 CPU 1518-4 PN/DP MFP","versions":[{"status":"affected","version":"V3.1.5","lessThan":"*","versionType":"custom"}],"defaultStatus":"unknown"}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-082556.html"},{"url":"https://cert-portal.siemens.com/productcert/html/ssa-032379.html"}]}]}}