Re: [PATCH] drivers/of: fdt: validate stdout-path properties before parsing them

From: Rob Herring (Arm)

Date: Mon Apr 13 2026 - 13:12:07 EST



On Fri, 03 Apr 2026 11:55:29 +0800, Pengpeng Hou wrote:
> early_init_dt_scan_chosen_stdout() fetches stdout-path and
> linux,stdout-path directly from the flat DT and immediately passes the
> result to strchrnul(). Flat DT properties are raw firmware-supplied
> byte sequences, and this path does not prove that either property is
> NUL-terminated within its declared bounds.
>
> Use fdt_stringlist_get() so malformed unterminated stdout-path
> properties are rejected before the local parser walks them as C
> strings.
>
> Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
> ---
> drivers/of/fdt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Applied, thanks!