]> git.baikalelectronics.ru Git - kernel.git/commit
of: fdt: fix off-by-one error in unflatten_dt_nodes()
authorSergey Shtylyov <s.shtylyov@omp.ru>
Sat, 13 Aug 2022 20:34:16 +0000 (23:34 +0300)
committerRob Herring <robh@kernel.org>
Tue, 16 Aug 2022 17:29:57 +0000 (11:29 -0600)
commit2fd8c6bff48ed8f4af46f2f3bbef32d9a35f5680
treef40cf7b20292387c6de93295d2f59211fe38fb1f
parent34a3249ab33a1690f58cd6e91a0208887337d3e0
of: fdt: fix off-by-one error in unflatten_dt_nodes()

Commit e2d5a793ec6e ("drivers/of: Fix depth when unflattening devicetree")
forgot to fix up the depth check in the loop body in unflatten_dt_nodes()
which makes it possible to overflow the nps[] buffer...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Fixes: e2d5a793ec6e ("drivers/of: Fix depth when unflattening devicetree")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/7c354554-006f-6b31-c195-cdfe4caee392@omp.ru
drivers/of/fdt.c