Files
linux/kernel
Masami Hiramatsu (Google) c1e2c63e65 tracing/probes: Fix missing BTF kind checks in char pointer/array helpers
In struct btf_type, the type ID and byte size share a union, and only
BTF_KIND_INT types are followed by a 32-bit integer encoding word.
Because btf_type_is_char_ptr() and btf_type_is_char_array() do not
verify that the outer type is BTF_KIND_PTR or that the resolved element
type is a non-NULL BTF_KIND_INT before inspecting it, non-pointer BTF
types can have their byte size misinterpreted as a BTF type ID, and
arrays of non-integer types read out-of-bounds or misinterpret trailing
BTF metadata as BTF_INT_* encoding bits.

Validate the BTF type kinds and NULL pointers before reading inner type
metadata in both helpers.

Link: https://lore.kernel.org/all/179455851632.403392.258264246782960594.stgit@devnote2/

Fixes: 27973e5c64 ("tracing/probes: Add string type check with BTF")
Cc: [email protected]
Signed-off-by: Masami Hiramatsu (Google) <[email protected]>
2026-11-13 23:04:56 +09:00
..
…
…
2026-09-28 08:44:41 +02:00
…
…
…
…
…
2026-11-11 12:32:07 +01:00
2026-10-12 11:13:01 +02:00
…
…
…
…
2026-10-24 00:46:49 -07:00
2026-01-26 19:07:13 -08:00
…
…
2026-09-04 12:46:45 +02:00