]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
lib/bootconfig: validate child node index in xbc_verify_tree()
authorJosh Law <objecting@objecting.org>
Wed, 18 Mar 2026 15:59:14 +0000 (15:59 +0000)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Wed, 18 Mar 2026 23:44:15 +0000 (08:44 +0900)
commit909bb3a6c53faf86e96694ed09e7f32cad11ba2e
tree7edee66cc16453dd15c22687b08417949d245a7f
parent2564fa0bb2dbee126cac03c9d916e6c6a7910f31
lib/bootconfig: validate child node index in xbc_verify_tree()

xbc_verify_tree() validates that each node's next index is within
bounds, but does not check the child index.  Add the same bounds
check for the child field.

Without this check, a corrupt bootconfig that passes next-index
validation could still trigger an out-of-bounds memory access via an
invalid child index when xbc_node_get_child() is called during tree
traversal at boot time.

Link: https://lore.kernel.org/all/20260318155919.78168-9-objecting@objecting.org/
Signed-off-by: Josh Law <objecting@objecting.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
lib/bootconfig.c