{"id":"CVE-2026-143365","summary":"bpf: Clamp the trace length in __bpf_get_stack() again","details":"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-\u003enr - 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-\u003enr 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.","modified":"2026-12-03T11:02:09.597496062Z","published":"2026-12-03T09:22:17.499Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143365.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/007fd460798be9af7d4874734f934afa47742f29"},{"type":"WEB","url":"https://git.kernel.org/stable/c/5e0ae0ed5db60a22aca6ef1f8aeed677bed323f9"},{"type":"WEB","url":"https://git.kernel.org/stable/c/7735e81c34d7aed929b4a3864941f675f34ea07f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f9045c09e95923b91d99916f0c821a4efbff4be4"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143365.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-143365"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"0c472ae306761526ba5e96bc4a618e29edb3a85c"},{"fixed":"7735e81c34d7aed929b4a3864941f675f34ea07f"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"8fc78e468f9e4dfaa278a84d0b349e2f773aa19b"},{"fixed":"5e0ae0ed5db60a22aca6ef1f8aeed677bed323f9"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"e17d62fedd10ae56e2426858bd0757da544dbc73"},{"fixed":"f9045c09e95923b91d99916f0c821a4efbff4be4"},{"fixed":"007fd460798be9af7d4874734f934afa47742f29"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"7944e9f95f36d09b37229d985a7d78e7c2edfb01"}]}],"versions":["v6.12.119","v6.12.118","v6.12.117","v6.12.116","v6.12.115","v6.12.114","v6.12.113","v6.12.112","v6.12.111","v6.12.110","v6.12.109","v6.12.108","v6.12.107","v6.12.106","v6.12.105","v6.12.104","v6.12.103","v6.12.102","v6.12.101","v6.12.100","v6.12.99","v6.12.98","v6.12.97","v6.12.96","v6.12.95","v6.12.94","v6.12.93","v6.12.92","v6.12.91","v6.12.90","v6.12.89","v6.12.88","v6.12.87","v6.12.86","v6.12.85","v6.12.84","v6.12.83","v6.12.82","v6.12.81","v6.12.80","v6.12.79","v6.12.78","v6.12.77","v6.12.76","v6.12.75","v6.12.74","v6.12.73","v6.12.72","v6.12.71","v6.12.70","v6.12.69","v6.12.68","v6.12.67","v6.12.66","v6.12.65","v6.12.64","v6.12.63","v6.18.65","v6.18.64","v6.18.63","v6.18.62","v6.18.61","v6.18.60","v6.18.59","v6.18.58","v6.18.57","v6.18.56","v6.18.55","v6.18.54","v6.18.53","v6.18.52","v6.18.51","v6.18.50","v6.18.49","v6.18.48","v6.18.47","v6.18.46","v6.18.45","v6.18.44","v6.18.43","v6.18.42","v6.18.41","v6.18.40","v6.18.39","v6.18.38","v6.18.37","v6.18.36","v6.18.35","v6.18.34","v6.18.33","v6.18.32","v6.18.31","v6.18.30","v6.18.29","v6.18.28","v6.18.27","v6.18.26","v6.18.25","v6.18.24","v6.18.23","v6.18.22","v6.18.21","v6.18.20","v6.18.19","v6.18.18","v6.18.17","v6.18.16","v6.18.15","v6.18.14","v6.18.13","v6.18.12","v6.18.11","v6.18.10","v6.18.9","v6.18.8","v6.18.7","v6.18.6","v6.18.5","v6.18.4","v6.18.3","v6.18.2","v6.17.13"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143365.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.12.63"},{"fixed":"6.12.120"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.17.13"},{"fixed":"6.18"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.18.2"},{"fixed":"6.18.66"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.7"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143365.json"}}],"schema_version":"1.9.2"}