{"id":"CVE-2023-54247","aliases":["CVE-2023-54247"],"related":[],"kind":"vulnerability","state":"published","title":"bpf: Silence a warning in btf_type_id_size()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Silence a warning in btf_type_id_size()\n\nsyzbot reported a warning in [1] with the following stacktrace:\n  WARNING: CPU: 0 PID: 5005 at kernel/bpf/btf.c:1988 btf_type_id_size+0x2d9/0x9d0 kernel/bpf/btf.c:1988\n  ...\n  RIP: 0010:btf_type_id_size+0x2d9/0x9d0 kernel/bpf/btf.c:1988\n  ...\n  Call Trace:\n   <TASK>\n   map_check_btf kernel/bpf/syscall.c:1024 [inline]\n   map_create+0x1157/0x1860 kernel/bpf/syscall.c:1198\n   __sys_bpf+0x127f/0x5420 kernel/bpf/syscall.c:5040\n   __do_sys_bpf kernel/bpf/syscall.c:5162 [inline]\n   __se_sys_bpf kernel/bpf/syscall.c:5160 [inline]\n   __x64_sys_bpf+0x79/0xc0 kernel/bpf/syscall.c:5160\n   do_syscall_x64 arch/x86/entry/common.c:50 [inline]\n   do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80\n   entry_SYSCALL_64_after_hwframe+0x63/0xcd\n\nWith the following btf\n  [1] DECL_TAG 'a' type_id=4 component_idx=-1\n  [2] PTR '(anon)' type_id=0\n  [3] TYPE_TAG 'a' type_id=2\n  [4] VAR 'a' type_id=3, linkage=static\nand when the bpf_attr.btf_key_type_id = 1 (DECL_TAG),\nthe following WARN_ON_ONCE in btf_type_id_size() is triggered:\n  if (WARN_ON_ONCE(!btf_type_is_modifier(size_type) &&\n                   !btf_type_is_var(size_type)))\n          return NULL;\n\nNote that 'return NULL' is the correct behavior as we don't want\na DECL_TAG type to be used as a btf_{key,value}_type_id even\nfor the case like 'DECL_TAG -> STRUCT'. So there\nis no correctness issue here, we just want to silence warning.\n\nTo silence the warning, I added DECL_TAG as one of kinds in\nbtf_type_nosize() which will cause btf_type_id_size() returning\nNULL earlier without the warning.\n\n  [1] https://lore.kernel.org/bpf/000000000000e0df8d05fc75ba86@google.com/","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Silence a warning in btf_type_id_size()\n\nsyzbot reported a warning in [1] with the following stacktrace:\n  WARNING: CPU: 0 PID: 5005 at kernel/bpf/btf.c:1988 btf_type_id_size+0x2d9/0x9d0 kernel/bpf/btf.c:1988\n  ...\n  RIP: 0010:btf_type_id_size+0x2d9/0x9d0 kernel/bpf/btf.c:1988\n  ...\n  Call Trace:\n   <TASK>\n   map_check_btf kernel/bpf/syscall.c:1024 [inline]\n   map_create+0x1157/0x1860 kernel/bpf/syscall.c:1198\n   __sys_bpf+0x127f/0x5420 kernel/bpf/syscall.c:5040\n   __do_sys_bpf kernel/bpf/syscall.c:5162 [inline]\n   __se_sys_bpf kernel/bpf/syscall.c:5160 [inline]\n   __x64_sys_bpf+0x79/0xc0 kernel/bpf/syscall.c:5160\n   do_syscall_x64 arch/x86/entry/common.c:50 [inline]\n   do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80\n   entry_SYSCALL_64_after_hwframe+0x63/0xcd\n\nWith the following btf\n  [1] DECL_TAG 'a' type_id=4 component_idx=-1\n  [2] PTR '(anon)' type_id=0\n  [3] TYPE_TAG 'a' type_id=2\n  [4] VAR 'a' type_id=3, linkage=static\nand when the bpf_attr.btf_key_type_id = 1 (DECL_TAG),\nthe following WARN_ON_ONCE in btf_type_id_size() is triggered:\n  if (WARN_ON_ONCE(!btf_type_is_modifier(size_type) &&\n                   !btf_type_is_var(size_type)))\n          return NULL;\n\nNote that 'return NULL' is the correct behavior as we don't want\na DECL_TAG type to be used as a btf_{key,value}_type_id even\nfor the case like 'DECL_TAG -> STRUCT'. So there\nis no correctness issue here, we just want to silence warning.\n\nTo silence the warning, I added DECL_TAG as one of kinds in\nbtf_type_nosize() which will cause btf_type_id_size() returning\nNULL earlier without the warning.\n\n  [1] https://lore.kernel.org/bpf/000000000000e0df8d05fc75ba86@google.com/","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nbpf: Silenciar una advertencia en btf_type_id_size()\n\nsyzbot informó una advertencia en [1] con el siguiente stacktrace:\n  WARNING: CPU: 0 PID: 5005 at kernel/bpf/btf.c:1988 btf_type_id_size+0x2d9/0x9d0 kernel/bpf/btf.c:1988\n  ...\n  RIP: 0010:btf_type_id_size+0x2d9/0x9d0 kernel/bpf/btf.c:1988\n  ...\n  Traza de Llamada:\n   \n   map_check_btf kernel/bpf/syscall.c:1024 [inline]\n   map_create+0x1157/0x1860 kernel/bpf/syscall.c:1198\n   __sys_bpf+0x127f/0x5420 kernel/bpf/syscall.c:5040\n   __do_sys_bpf kernel/bpf/syscall.c:5162 [inline]\n   __se_sys_bpf kernel/bpf/syscall.c:5160 [inline]\n   __x64_sys_bpf+0x79/0xc0 kernel/bpf/syscall.c:5160\n   do_syscall_x64 arch/x86/entry/common.c:50 [inline]\n   do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80\n   entry_SYSCALL_64_after_hwframe+0x63/0xcd\n\nCon el siguiente btf\n  [1] DECL_TAG 'a' type_id=4 component_idx=-1\n  [2] PTR '(anon)' type_id=0\n  [3] TYPE_TAG 'a' type_id=2\n  [4] VAR 'a' type_id=3, linkage=static\ny cuando bpf_attr.btf_key_type_id = 1 (DECL_TAG),\nel siguiente WARN_ON_ONCE en btf_type_id_size() se activa:\n  if (WARN_ON_ONCE(!btf_type_is_modifier(size_type) &amp;&amp;\n                   !btf_type_is_var(size_type)))\n          return NULL;\n\nTenga en cuenta que 'return NULL' es el comportamiento correcto ya que no queremos\nque un tipo DECL_TAG sea usado como btf_{key,value}_type_id incluso\npara el caso como 'DECL_TAG -&gt; STRUCT'. Así que no hay\nningún problema de corrección aquí, solo queremos silenciar la advertencia.\n\nPara silenciar la advertencia, agregué DECL_TAG como uno de los tipos en\nbtf_type_nosize() lo que hará que btf_type_id_size() devuelva\nNULL antes sin la advertencia.\n\n  [1] https://lore.kernel.org/bpf/000000000000e0df8d05fc75ba86@google.com/","source":"nvd"}],"published":"2025-12-30T12:15:45.395Z","modified":"2026-06-17T06:47:05.280Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef","fixed":"61f4bd46a03a81865aca3bcbad2f7b7032fb3160","status":"affected"},{"type":"git","introduced":"b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef","fixed":"7c4f5ab63e7962812505cbd38cc765168a223acb","status":"affected"},{"type":"git","introduced":"b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef","fixed":"e6c2f594ed961273479505b42040782820190305","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.16","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.16","status":"unaffected"},{"type":"semver","introduced":"6.1.110","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.4.7","lastAffected":"6.4.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.5","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/61f4bd46a03a81865aca3bcbad2f7b7032fb3160","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7c4f5ab63e7962812505cbd38cc765168a223acb","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e6c2f594ed961273479505b42040782820190305","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-54247","url":"https://www.cve.org/CVERecord?id=CVE-2023-54247","licence":"CVE Terms of Use","modified":"2026-05-11T19:58:18.212Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-54247","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-54247","licence":"Public domain","modified":"2026-06-17T06:47:05.280Z"}],"updatedAt":"2026-11-25T22:58:35.241Z","epss":{"score":0.00212,"percentile":0.12175,"date":"2026-12-01T12:00:22.000Z"}}