{"id":"CVE-2026-139309","summary":"bpf: Bound the nesting that the BTF show code follows","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Bound the nesting that the BTF show code follows\n\nbtf_struct_show() and btf_array_show() recurse for every nested struct\nand array.  MAX_RESOLVE_DEPTH bounds one resolve walk when BTF is loaded,\nnot the nesting: a member whose type is resolved already is not walked\nagain, so BTF that defines its types from the inside out can nest them as\ndeep as it has types.\n\nWhoever may load BTF, with CAP_BPF or a BPF token, can give such a type\nto the value of a map.  Reading the file of that map in bpffs then\noverruns the kernel stack: with a few hundred levels the stack guard page\nis hit and the kernel panics.\n\nStop at 32 levels.  That is MAX_RESOLVE_DEPTH, and __btf_show_indent()\nhas as many columns.  Nothing is shown for a member that lies deeper, and\nthe status becomes -E2BIG, which bpf_snprintf_btf() and\nbpf_seq_printf_btf() return.  The types of an x86_64 defconfig kernel nest\n14 deep.","modified":"2026-11-30T15:01:28.823188416Z","published":"2026-11-30T13:33:33.765Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139309.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/13ac7c05bc45d3445b580da186548dd3487fae4e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/1e1df9e7ae908e576cd32227b554fbfedfb51653"},{"type":"WEB","url":"https://git.kernel.org/stable/c/223bd268d8a86711dd98610899486eb6e0889c67"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3a59b5615c75bd737e1e5c93653c18522e773bfd"},{"type":"WEB","url":"https://git.kernel.org/stable/c/4b6487fc895e70889f58db1291618e7cd390458b"},{"type":"WEB","url":"https://git.kernel.org/stable/c/696b05fe5397637dee8c69deec988030b59e688d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/72ea9edd9eae351ba1b32ab98be5cedc0fe6cb75"},{"type":"WEB","url":"https://git.kernel.org/stable/c/be380aa90cabe89a93f8308017d8d9329e7bee74"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139309.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139309"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"b00b8daec828dd59af7d1f7a42acd6e5867f80c6"},{"fixed":"3a59b5615c75bd737e1e5c93653c18522e773bfd"},{"fixed":"be380aa90cabe89a93f8308017d8d9329e7bee74"},{"fixed":"223bd268d8a86711dd98610899486eb6e0889c67"},{"fixed":"4b6487fc895e70889f58db1291618e7cd390458b"},{"fixed":"1e1df9e7ae908e576cd32227b554fbfedfb51653"},{"fixed":"696b05fe5397637dee8c69deec988030b59e688d"},{"fixed":"72ea9edd9eae351ba1b32ab98be5cedc0fe6cb75"},{"fixed":"13ac7c05bc45d3445b580da186548dd3487fae4e"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139309.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.18.0"},{"fixed":"5.10.275"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.226"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.119"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.65"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.6"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139309.json"}}],"schema_version":"1.9.2"}