{"id":"CVE-2026-139619","state":"PUBLISHED","title":"powerpc/ftrace: Don't restore r13 during ftrace_regs_caller","description":"In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc/ftrace: Don't restore r13 during ftrace_regs_caller\n\nMichal reported a stack-protector failure and subsequent panic when\nrunning kernel builds. This was observed with full/lazy preemption.\nInitially it was suspected as KVM, but later turned out to be due\nto a bcc tool running in parallel.\n\nIssue was recreated using a bcc tool.\nFor example, running below in parallel leads to crash.\n./funccount sched* -d 100 and make -j 64\n\nThe same crash was observed when running kprobe for schedule() function,\nwhile simpler function tracer for schedule() didn't cause the crash.\nThis helped to narrow it down to ftrace backed kprobes area.\n\nThe crash occurs as follows:\n\nftrace_regs_caller entry on CPU A\n    |\n    +-> save r13 = CPU A PACA into pt_regs\n    |\n    +-> call kprobe_ftrace_handler()\n            |\n            +-> ftrace_test_recursion_unlock()\n                    |\n                    +-> preempt_enable\n                    +-> task can schedule and migrate to CPU B\n                    +-> task resumes with live r13 = CPU B PACA\n    |\n    +-> REST_GPRS(2, 31)\n            |\n            +-> restore saved r13 = CPU A PACA\n    |\n    |-> The task then continues running on CPU B with r13 pointing\n    |   to CPU A's PACA.\n\nThe stack-protector canary is accessed through the PACA. After the task\nmigrates, CPU A may run a different task and update its PACA with that\ntask's canary. Restoring the saved r13 then causes the migrated task's\nsaved stack canary to be compared against the canary in CPU A's PACA,\nresulting in a stack-protector failure.\n\nSimilarly, current is resolved through the PACA. With a stale r13,\npreempt_count() can access the state of the task referenced by CPU A's\nPACA instead of the task running on CPU B. This results in corrupted\npreempt-count warnings and scheduling-while-atomic failures.\n\nThis path for example is called when using kprobes and parallel kernel\nbuilds can cause preemptions during ftrace_test_recursion_unlock.\n\nDo not restore r13 from the saved register frame. If the task did not\nmigrate, the live r13 already has the saved value. If it migrated, the\nlive r13 contains the correct PACA pointer for the CPU on which the task\nresumed.\n\nOn PPC32, r13 is regular register. So do this fix only for PPC64","publishedAt":"2026-11-30T13:36:25.540Z","updatedAt":"2026-11-30T13:36:25.540Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"153086644fd1fb07fb3af84d9f11542a19b1e8b6","status":"affected","lessThan":"366922b28c204239e152c2f93ddcc78ef6427c33","versionType":"git"},{"version":"153086644fd1fb07fb3af84d9f11542a19b1e8b6","status":"affected","lessThan":"6ea49e208b40bececc246dbe3f9e804b07a5eb78","versionType":"git"},{"version":"153086644fd1fb07fb3af84d9f11542a19b1e8b6","status":"affected","lessThan":"d4c2840ee6b10543a03a3e5c7259df6cbdd4509c","versionType":"git"},{"version":"153086644fd1fb07fb3af84d9f11542a19b1e8b6","status":"affected","lessThan":"7880dfae923cdf3176e3b5e071c5ca5b1a5f3693","versionType":"git"},{"version":"153086644fd1fb07fb3af84d9f11542a19b1e8b6","status":"affected","lessThan":"af5f0870883ae4aea7f668d06cbb7ad0e12824c8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/powerpc/kernel/trace/ftrace_entry.S"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.6","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/powerpc/kernel/trace/ftrace_entry.S"]}],"references":["https://git.kernel.org/stable/c/366922b28c204239e152c2f93ddcc78ef6427c33","https://git.kernel.org/stable/c/6ea49e208b40bececc246dbe3f9e804b07a5eb78","https://git.kernel.org/stable/c/d4c2840ee6b10543a03a3e5c7259df6cbdd4509c","https://git.kernel.org/stable/c/7880dfae923cdf3176e3b5e071c5ca5b1a5f3693","https://git.kernel.org/stable/c/af5f0870883ae4aea7f668d06cbb7ad0e12824c8"],"weaknesses":[],"ingestedAt":"2026-11-30T13:52:04.503Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139619.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139619","state":"PUBLISHED","datePublished":"2026-11-30T13:36:25.540Z","dateUpdated":"2026-11-30T13:36:25.540Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.943Z"},"containers":{"cna":{"title":"powerpc/ftrace: Don't restore r13 during ftrace_regs_caller","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc/ftrace: Don't restore r13 during ftrace_regs_caller\n\nMichal reported a stack-protector failure and subsequent panic when\nrunning kernel builds. This was observed with full/lazy preemption.\nInitially it was suspected as KVM, but later turned out to be due\nto a bcc tool running in parallel.\n\nIssue was recreated using a bcc tool.\nFor example, running below in parallel leads to crash.\n./funccount sched* -d 100 and make -j 64\n\nThe same crash was observed when running kprobe for schedule() function,\nwhile simpler function tracer for schedule() didn't cause the crash.\nThis helped to narrow it down to ftrace backed kprobes area.\n\nThe crash occurs as follows:\n\nftrace_regs_caller entry on CPU A\n    |\n    +-> save r13 = CPU A PACA into pt_regs\n    |\n    +-> call kprobe_ftrace_handler()\n            |\n            +-> ftrace_test_recursion_unlock()\n                    |\n                    +-> preempt_enable\n                    +-> task can schedule and migrate to CPU B\n                    +-> task resumes with live r13 = CPU B PACA\n    |\n    +-> REST_GPRS(2, 31)\n            |\n            +-> restore saved r13 = CPU A PACA\n    |\n    |-> The task then continues running on CPU B with r13 pointing\n    |   to CPU A's PACA.\n\nThe stack-protector canary is accessed through the PACA. After the task\nmigrates, CPU A may run a different task and update its PACA with that\ntask's canary. Restoring the saved r13 then causes the migrated task's\nsaved stack canary to be compared against the canary in CPU A's PACA,\nresulting in a stack-protector failure.\n\nSimilarly, current is resolved through the PACA. With a stale r13,\npreempt_count() can access the state of the task referenced by CPU A's\nPACA instead of the task running on CPU B. This results in corrupted\npreempt-count warnings and scheduling-while-atomic failures.\n\nThis path for example is called when using kprobes and parallel kernel\nbuilds can cause preemptions during ftrace_test_recursion_unlock.\n\nDo not restore r13 from the saved register frame. If the task did not\nmigrate, the live r13 already has the saved value. If it migrated, the\nlive r13 contains the correct PACA pointer for the CPU on which the task\nresumed.\n\nOn PPC32, r13 is regular register. So do this fix only for PPC64"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"153086644fd1fb07fb3af84d9f11542a19b1e8b6","status":"affected","lessThan":"366922b28c204239e152c2f93ddcc78ef6427c33","versionType":"git"},{"version":"153086644fd1fb07fb3af84d9f11542a19b1e8b6","status":"affected","lessThan":"6ea49e208b40bececc246dbe3f9e804b07a5eb78","versionType":"git"},{"version":"153086644fd1fb07fb3af84d9f11542a19b1e8b6","status":"affected","lessThan":"d4c2840ee6b10543a03a3e5c7259df6cbdd4509c","versionType":"git"},{"version":"153086644fd1fb07fb3af84d9f11542a19b1e8b6","status":"affected","lessThan":"7880dfae923cdf3176e3b5e071c5ca5b1a5f3693","versionType":"git"},{"version":"153086644fd1fb07fb3af84d9f11542a19b1e8b6","status":"affected","lessThan":"af5f0870883ae4aea7f668d06cbb7ad0e12824c8","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/powerpc/kernel/trace/ftrace_entry.S"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.6","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["arch/powerpc/kernel/trace/ftrace_entry.S"]}],"references":[{"url":"https://git.kernel.org/stable/c/366922b28c204239e152c2f93ddcc78ef6427c33"},{"url":"https://git.kernel.org/stable/c/6ea49e208b40bececc246dbe3f9e804b07a5eb78"},{"url":"https://git.kernel.org/stable/c/d4c2840ee6b10543a03a3e5c7259df6cbdd4509c"},{"url":"https://git.kernel.org/stable/c/7880dfae923cdf3176e3b5e071c5ca5b1a5f3693"},{"url":"https://git.kernel.org/stable/c/af5f0870883ae4aea7f668d06cbb7ad0e12824c8"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:36:25.540Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.6","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.6","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.6","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.6","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.6","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}