summaryrefslogtreecommitdiff
path: root/rust/kernel/debugfs
diff options
context:
space:
mode:
authorKarl Mehltretter <kmehltretter@gmail.com>2026-08-27 07:37:41 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-09-09 17:26:03 +0200
commitd776369a9eded071df83e4738e1572c4c5b912d7 (patch)
tree3442983488e5492848c6917054eca3cf6fa401c4 /rust/kernel/debugfs
parentdf2908090cda368b01ff43709f51890076c56157 (diff)
ACPI: pfr_update: zero-initialize capability query result
query_capability() copies four ACPI buffers into fixed-size fields using the firmware-supplied lengths. The existing overflow guard rejects oversized buffers, but shorter buffers are accepted and leave trailing bytes of the stack-allocated cap_hdr uninitialized. PFRU_IOC_QUERY_CAP then copies the entire structure to userspace. Zero-initialize cap_hdr before querying the firmware. This preserves the existing handling of short firmware responses while preventing disclosure of kernel stack data. Oversized buffers remain rejected. A QEMU _DSM returning one-byte buffers reproduced nonzero stack suffix bytes in all four fields. With this change, the ioctl still succeeds and each unwritten suffix is zero-filled, while 64-byte buffers continue to return -EINVAL. Fixes: 0db89fa243e5 ("ACPI: Introduce Platform Firmware Runtime Update device driver") Reported-by: Sashiko <sashiko-bot@kernel.org> Closes: https://sashiko.dev/#/patchset/1a001e1fee9.637da6dc3533246.238498880682901704%40a0rg.com Cc: All applicable <stable@vger.kernel.org> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Link: https://patch.msgid.link/20260827053741.79425-1-kmehltretter@gmail.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'rust/kernel/debugfs')
0 files changed, 0 insertions, 0 deletions