]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drivers/of: fdt: validate stdout-path properties before parsing them
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Fri, 3 Apr 2026 03:55:29 +0000 (11:55 +0800)
committerRob Herring (Arm) <robh@kernel.org>
Mon, 13 Apr 2026 20:01:26 +0000 (15:01 -0500)
commitbb04fcc89a889ad7d5e3427cd1afddd924ef691c
tree82b59efa73d20b089eff56b290706d2c437b99da
parent38fe5379504ffd300f8546249ffa0e8d0000e94c
drivers/of: fdt: validate stdout-path properties before parsing them

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@iscas.ac.cn>
Link: https://patch.msgid.link/20260403143001.1-dt-fdt-stdout-pengpeng@iscas.ac.cn
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
drivers/of/fdt.c