summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJamie Nguyen <jamien@nvidia.com>2026-05-18 23:31:16 +0300
committerSudeep Holla <sudeep.holla@kernel.org>2026-05-19 21:04:28 +0300
commit01b9cae706161a39452a2cce0f281d4369344c51 (patch)
tree82aaffa585e48fd20b85570032e30917187e013a /include/linux
parent3acc80a78e45246a87061cbdd46775baa132de83 (diff)
downloadlinux-01b9cae706161a39452a2cce0f281d4369344c51.tar.xz
firmware: arm_ffa: Honor partition info descriptor size
FFA_PARTITION_INFO_GET_REGS reports the size of each partition information descriptor in x2[63:48]. However, __ffa_partition_info_get_regs() walks the returned register payload with a hardcoded 24-byte stride (regs += 3), even though the size is already read into buf_sz. That works for the FF-A v1.1/v1.2 24-byte descriptor layout, where each descriptor consumes three registers. Newer FF-A revisions can extend the descriptor while keeping the existing fields at the front. For example, a 48-byte descriptor consumes six registers, so advancing by only three registers desynchronises the parser and can make it read subsequent entries from the middle of a descriptor. Use the advertised descriptor size to derive the register stride. Validate that the size is register-aligned, large enough for the fields parsed by the driver, and that the requested number of descriptors fits in the returned x3..x17 register window. The driver still copies only the fields it understands, but now skips over any trailing descriptor fields correctly. Fixes: ba85c644ac8d ("firmware: arm_ffa: Add support for FFA_PARTITION_INFO_GET_REGS") Suggested-by: Sudeep Holla <sudeep.holla@kernel.org> Signed-off-by: Jamie Nguyen <jamien@nvidia.com> Link: https://patch.msgid.link/20260518203116.42624-1-jamien@nvidia.com (sudeep.holla: Minor rewordng of the commit message and subject) Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions