]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:03:56 +0000 (11:03 +0200)
commit2eadf6dec2785bfca171b846b123189c317fd12a
tree91a943acdf23f6c5a4a8e47d24c36b50bbb8e2f2
parent63480a3bef1354221c5c8673865407f99522262c
of: fdt: fix off-by-one error in unflatten_dt_nodes()

[ Upstream commit 75da63ab10d91a14ef3d1146f64e1a562e0806c8 ]

Commit 58bf7975fdfd ("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: 58bf7975fdfd ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/of/fdt.c