[PATCH RESEND v2 42/51] powerpc/pseries: bound the lengths in the ofdt property parser
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Nov 5 11:30:14 PST 2026
> The commands for /proc/powerpc/ofdt that carry properties, "add_node",
> "add_property" and "update_property", can make the parser read past the
> buffer they were copied into:
>
> (1) do_update_property() computes the end of the buffer after
> parse_node() moved buf past the phandle. So the end is off by the
> length of the phandle string, which can be padded with zeroes, and
> parse_next_property() accepts a value that reaches that far past
> the command. new_property() then copies those bytes into the
> property, which everyone can read in /proc/device-tree.
>
> (2) parse_next_property() parses the length with simple_strtoul() into
> an int and only rejects -1. A length above INT_MAX turns negative,
> tmp += *length moves backwards and passes the check against the
> end, so *tmp is read up to 2G in front of the buffer.
> [ ... ]
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Fixes: 610d91511f99 ("[PATCH] powerpc: Add support for changing properties from userspace")
> Fixes: 46db2f86a3b2 ("powerpc/pseries: Fix to handle slb resize across migration")
> Cc: stable at vger.kernel.org
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-work-procfs-bugfixes-v2-0-021c84d852e0@kernel.org?part=42
More information about the kexec
mailing list