{"id":"CVE-2026-143365","state":"PUBLISHED","title":"bpf: Clamp the trace length in __bpf_get_stack() again","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Clamp the trace length in __bpf_get_stack() again\n\nget_perf_callchain() and get_callchain_entry_for_task() store a trace in a\nper-CPU entry, one per context. They release the entry before they return\nit. Thus a second user in the same context can write to the entry while the\nfirst user reads it. preempt_disable() stops only other tasks.\n\n__bpf_get_stack() requests at most max_depth frames. This is skip plus the\nframes that fit in the buffer, but not more than perf_event_max_stack.\nSince the commit below, it copies 'trace->nr - skip' frames with no limit.\nBut a second user can store a longer trace. The unwinders of PowerPC add\ncontext markers that max_depth does not limit. In both cases the copy\nwrites after the end of the buffer.\n\nRead trace->nr one time. Clamp the value to max_depth before the skip test,\nas __bpf_get_stack_pe() does. Thus when max_depth is less than skip, the\nhelper returns -EFAULT, and 'trace_nr - skip' does not underflow. The\ncopied frames can still be those of the second user.","publishedAt":"2026-12-03T09:22:17.499Z","updatedAt":"2026-12-03T09:22:17.499Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0c472ae306761526ba5e96bc4a618e29edb3a85c","status":"affected","lessThan":"7735e81c34d7aed929b4a3864941f675f34ea07f","versionType":"git"},{"version":"8fc78e468f9e4dfaa278a84d0b349e2f773aa19b","status":"affected","lessThan":"5e0ae0ed5db60a22aca6ef1f8aeed677bed323f9","versionType":"git"},{"version":"e17d62fedd10ae56e2426858bd0757da544dbc73","status":"affected","lessThan":"f9045c09e95923b91d99916f0c821a4efbff4be4","versionType":"git"},{"version":"e17d62fedd10ae56e2426858bd0757da544dbc73","status":"affected","lessThan":"007fd460798be9af7d4874734f934afa47742f29","versionType":"git"},{"version":"7944e9f95f36d09b37229d985a7d78e7c2edfb01","status":"affected","versionType":"git"},{"version":"6.12.63","status":"affected","lessThan":"6.12.120","versionType":"semver"},{"version":"6.18.2","status":"affected","lessThan":"6.18.66","versionType":"semver"},{"version":"6.17.13","status":"affected","lessThan":"6.18","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/stackmap.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.19","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/stackmap.c"]}],"references":["https://git.kernel.org/stable/c/7735e81c34d7aed929b4a3864941f675f34ea07f","https://git.kernel.org/stable/c/5e0ae0ed5db60a22aca6ef1f8aeed677bed323f9","https://git.kernel.org/stable/c/f9045c09e95923b91d99916f0c821a4efbff4be4","https://git.kernel.org/stable/c/007fd460798be9af7d4874734f934afa47742f29"],"weaknesses":[],"ingestedAt":"2026-12-03T09:44:04.436Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143365.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143365","state":"PUBLISHED","datePublished":"2026-12-03T09:22:17.499Z","dateUpdated":"2026-12-03T09:22:17.499Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.371Z"},"containers":{"cna":{"title":"bpf: Clamp the trace length in __bpf_get_stack() again","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Clamp the trace length in __bpf_get_stack() again\n\nget_perf_callchain() and get_callchain_entry_for_task() store a trace in a\nper-CPU entry, one per context. They release the entry before they return\nit. Thus a second user in the same context can write to the entry while the\nfirst user reads it. preempt_disable() stops only other tasks.\n\n__bpf_get_stack() requests at most max_depth frames. This is skip plus the\nframes that fit in the buffer, but not more than perf_event_max_stack.\nSince the commit below, it copies 'trace->nr - skip' frames with no limit.\nBut a second user can store a longer trace. The unwinders of PowerPC add\ncontext markers that max_depth does not limit. In both cases the copy\nwrites after the end of the buffer.\n\nRead trace->nr one time. Clamp the value to max_depth before the skip test,\nas __bpf_get_stack_pe() does. Thus when max_depth is less than skip, the\nhelper returns -EFAULT, and 'trace_nr - skip' does not underflow. The\ncopied frames can still be those of the second user."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"0c472ae306761526ba5e96bc4a618e29edb3a85c","status":"affected","lessThan":"7735e81c34d7aed929b4a3864941f675f34ea07f","versionType":"git"},{"version":"8fc78e468f9e4dfaa278a84d0b349e2f773aa19b","status":"affected","lessThan":"5e0ae0ed5db60a22aca6ef1f8aeed677bed323f9","versionType":"git"},{"version":"e17d62fedd10ae56e2426858bd0757da544dbc73","status":"affected","lessThan":"f9045c09e95923b91d99916f0c821a4efbff4be4","versionType":"git"},{"version":"e17d62fedd10ae56e2426858bd0757da544dbc73","status":"affected","lessThan":"007fd460798be9af7d4874734f934afa47742f29","versionType":"git"},{"version":"7944e9f95f36d09b37229d985a7d78e7c2edfb01","status":"affected","versionType":"git"},{"version":"6.12.63","status":"affected","lessThan":"6.12.120","versionType":"semver"},{"version":"6.18.2","status":"affected","lessThan":"6.18.66","versionType":"semver"},{"version":"6.17.13","status":"affected","lessThan":"6.18","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/stackmap.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.19","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["kernel/bpf/stackmap.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/7735e81c34d7aed929b4a3864941f675f34ea07f"},{"url":"https://git.kernel.org/stable/c/5e0ae0ed5db60a22aca6ef1f8aeed677bed323f9"},{"url":"https://git.kernel.org/stable/c/f9045c09e95923b91d99916f0c821a4efbff4be4"},{"url":"https://git.kernel.org/stable/c/007fd460798be9af7d4874734f934afa47742f29"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:22:17.499Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12.63","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18.2","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.19","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.19","versionEndExcluding":"7.4-rc2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.17.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}