diff options
| author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-11-13 17:28:36 +0900 |
|---|---|---|
| committer | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-11-13 23:04:56 +0900 |
| commit | c1e2c63e65421068566db3dde44dfd4fe7adb46d (patch) | |
| tree | 1fc745b93e24da480f57613d0c99fb61c36cb54c /rust/kernel/alloc/allocator | |
| parent | 9b6e9d6a11090ac34516c45f48663b37ac94a9b1 (diff) | |
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: 27973e5c64b9 ("tracing/probes: Add string type check with BTF")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Diffstat (limited to 'rust/kernel/alloc/allocator')
0 files changed, 0 insertions, 0 deletions
