diff options
| author | Jamie Nguyen <jamien@nvidia.com> | 2026-10-13 11:07:28 -0700 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-10-22 20:25:49 +0200 |
| commit | 4d23d84ef2d04ba554b3063931dd12bed4223e1f (patch) | |
| tree | 82a10703a68796b0d837b9fac67f378c635997d4 /tools/lib/python/kdoc/python_version.py | |
| parent | 68a385dbe05fd8da69ec8a7753591fd653f97d89 (diff) | |
ACPI: sysfs: Map only the requested range in acpi_data_show()
acpi_data_show() maps the whole data region on every read(), although
it copies at most count bytes and sysfs passes at most PAGE_SIZE bytes
per call. acpi_os_unmap_iomem() defers the iounmap until after an RCU
grace period, so a process reading one of these files in a loop keeps
many full-size mappings in flight.
Map only the range being read. acpi_os_map_iomem() rounds the mapping
to page boundaries, so each mapping is now at most two pages, whatever
the size of the region.
A malformed table can describe a region that wraps around the end of
the physical address space. acpi_os_map_iomem() doesn't check for that,
and its lookup of existing mappings then matches an unrelated mapping,
with or without this change. Fail reads of such a region before mapping
anything.
Signed-off-by: Jamie Nguyen <jamien@nvidia.com>
Link: https://patch.msgid.link/20261013180728.957618-1-jamien@nvidia.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
