{"id":"CVE-2025-71109","state":"PUBLISHED","title":"MIPS: ftrace: Fix memory corruption when kernel is located beyond 32 bits","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nMIPS: ftrace: Fix memory corruption when kernel is located beyond 32 bits\n\nSince commit e424054000878 (\"MIPS: Tracing: Reduce the overhead of\ndynamic Function Tracer\"), the macro UASM_i_LA_mostly has been used,\nand this macro can generate more than 2 instructions. At the same\ntime, the code in ftrace assumes that no more than 2 instructions can\nbe generated, which is why it stores them in an int[2] array. However,\nas previously noted, the macro UASM_i_LA_mostly (and now UASM_i_LA)\ncauses a buffer overflow when _mcount is beyond 32 bits. This leads to\ncorruption of the variables located in the __read_mostly section.\n\nThis corruption was observed because the variable\n__cpu_primary_thread_mask was corrupted, causing a hang very early\nduring boot.\n\nThis fix prevents the corruption by avoiding the generation of\ninstructions if they could exceed 2 instructions in\nlength. Fortunately, insn_la_mcount is only used if the instrumented\ncode is located outside the kernel code section, so dynamic ftrace can\nstill be used, albeit in a more limited scope. This is still\npreferable to corrupting memory and/or crashing the kernel.","publishedAt":"2026-01-14T15:05:57.236Z","updatedAt":"2026-10-30T12:23:27.020Z","severity":{"score":7.1,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e424054000878d7eb11e44289242886d6e219d22","status":"affected","lessThan":"3f7a003fe2646337fbc5dd41051ad6754ac34064","versionType":"git"},{"version":"e424054000878d7eb11e44289242886d6e219d22","status":"affected","lessThan":"9cfda98cf02eacfa6b09076e98bd479fd73407c2","versionType":"git"},{"version":"e424054000878d7eb11e44289242886d6e219d22","status":"affected","lessThan":"e3e33ac2eb69d595079a1a1e444c2fb98efdd42d","versionType":"git"},{"version":"e424054000878d7eb11e44289242886d6e219d22","status":"affected","lessThan":"7f39b9d0e86ed6236b9a5fb67616ab1f76c4f150","versionType":"git"},{"version":"e424054000878d7eb11e44289242886d6e219d22","status":"affected","lessThan":"36dac9a3dda1f2bae343191bc16b910c603cac25","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/mips/kernel/ftrace.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.35","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.35","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.64","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.3","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/mips/kernel/ftrace.c"]}],"references":["https://git.kernel.org/stable/c/3f7a003fe2646337fbc5dd41051ad6754ac34064","https://git.kernel.org/stable/c/9cfda98cf02eacfa6b09076e98bd479fd73407c2","https://git.kernel.org/stable/c/e3e33ac2eb69d595079a1a1e444c2fb98efdd42d","https://git.kernel.org/stable/c/7f39b9d0e86ed6236b9a5fb67616ab1f76c4f150","https://git.kernel.org/stable/c/36dac9a3dda1f2bae343191bc16b910c603cac25"],"weaknesses":[],"ingestedAt":"2026-10-30T12:40:04.423Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/71xxx/CVE-2025-71109.json","commit":"db8103c5921aac81d5d90efcf3745980dafabf49","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-71109","state":"PUBLISHED","datePublished":"2026-01-14T15:05:57.236Z","dateUpdated":"2026-10-30T12:23:27.020Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-01-13T15:30:19.652Z"},"containers":{"cna":{"title":"MIPS: ftrace: Fix memory corruption when kernel is located beyond 32 bits","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nMIPS: ftrace: Fix memory corruption when kernel is located beyond 32 bits\n\nSince commit e424054000878 (\"MIPS: Tracing: Reduce the overhead of\ndynamic Function Tracer\"), the macro UASM_i_LA_mostly has been used,\nand this macro can generate more than 2 instructions. At the same\ntime, the code in ftrace assumes that no more than 2 instructions can\nbe generated, which is why it stores them in an int[2] array. However,\nas previously noted, the macro UASM_i_LA_mostly (and now UASM_i_LA)\ncauses a buffer overflow when _mcount is beyond 32 bits. This leads to\ncorruption of the variables located in the __read_mostly section.\n\nThis corruption was observed because the variable\n__cpu_primary_thread_mask was corrupted, causing a hang very early\nduring boot.\n\nThis fix prevents the corruption by avoiding the generation of\ninstructions if they could exceed 2 instructions in\nlength. Fortunately, insn_la_mcount is only used if the instrumented\ncode is located outside the kernel code section, so dynamic ftrace can\nstill be used, albeit in a more limited scope. This is still\npreferable to corrupting memory and/or crashing the kernel."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"e424054000878d7eb11e44289242886d6e219d22","status":"affected","lessThan":"3f7a003fe2646337fbc5dd41051ad6754ac34064","versionType":"git"},{"version":"e424054000878d7eb11e44289242886d6e219d22","status":"affected","lessThan":"9cfda98cf02eacfa6b09076e98bd479fd73407c2","versionType":"git"},{"version":"e424054000878d7eb11e44289242886d6e219d22","status":"affected","lessThan":"e3e33ac2eb69d595079a1a1e444c2fb98efdd42d","versionType":"git"},{"version":"e424054000878d7eb11e44289242886d6e219d22","status":"affected","lessThan":"7f39b9d0e86ed6236b9a5fb67616ab1f76c4f150","versionType":"git"},{"version":"e424054000878d7eb11e44289242886d6e219d22","status":"affected","lessThan":"36dac9a3dda1f2bae343191bc16b910c603cac25","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/mips/kernel/ftrace.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.35","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.35","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.64","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.3","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/mips/kernel/ftrace.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/3f7a003fe2646337fbc5dd41051ad6754ac34064"},{"url":"https://git.kernel.org/stable/c/9cfda98cf02eacfa6b09076e98bd479fd73407c2"},{"url":"https://git.kernel.org/stable/c/e3e33ac2eb69d595079a1a1e444c2fb98efdd42d"},{"url":"https://git.kernel.org/stable/c/7f39b9d0e86ed6236b9a5fb67616ab1f76c4f150"},{"url":"https://git.kernel.org/stable/c/36dac9a3dda1f2bae343191bc16b910c603cac25"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","baseScore":7.1,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The overflow occurs only during local MIPS kernel boot-time ftrace initialization; no network, radio, or device-input handler reaches it.\nAC:L - On an affected build with dynamic ftrace and _mcount beyond 32-bit compatibility space, the overflow occurs deterministically during every boot without a race or heap grooming.\nPR:L - No ftrace or tracefs permission check gates the vulnerable boot path, which executes before userspace; conservatively, ordinary local access is sufficient rather than requiring real root.\nUI:N - The vulnerable instruction generation happens automatically during normal kernel boot without requiring a victim to enable tracing, mount tracefs, or open a file.\nS:U - The corruption affects the same kernel security authority and does not cross a VM, IOMMU, or sandbox boundary.\nC:N - The bounded overwrite emits deterministic MIPS instruction words and provides no identified memory-read primitive or path for returning corrupted memory to an attacker.\nI:H - Up to several instructions are written beyond the two-word array into adjacent kernel globals, constituting an out-of-bounds kernel write capable of corrupting security-critical state.\nA:H - Corruption of __cpu_primary_thread_mask was observed to hang the kernel very early during boot, preventing affected servers, embedded controllers, or automotive systems from becoming operational."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:23:27.020Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.35","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.35","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.35","versionEndExcluding":"6.12.64"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.35","versionEndExcluding":"6.18.3"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.35","versionEndExcluding":"6.19"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}