diff options
| author | Ian Rogers <irogers@google.com> | 2025-11-18 21:05:54 -0800 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2025-11-19 16:20:15 -0800 |
| commit | 245cfbcd3d3b298c75e01946262b3ff2cf7d0796 (patch) | |
| tree | 84ac43f58e16fa1c8f46cb366898211554bf5b88 /tools/lib/python/kdoc/python_version.py | |
| parent | 51d87d977ec4efe000ac662ac924f00b9d8a23ec (diff) | |
perf maps: Avoid RC_CHK use after free
The case of __maps__fixup_overlap_and_insert where the "new" maps
covers existing mappings can create a use-after-free with reference
count checking enabled. The issue is that "pos" holds a map pointer
from maps_by_address that is put from maps_by_address but then used to
look for a map in maps_by_name (the compared map is now a
use-after-free). The issue stems from using maps__remove which redoes
some of the searches already done by __maps__fixup_overlap_and_insert,
so optimize the code (by avoiding repeated searches) and avoid the
use-after-free by inlining the appropriate removal code.
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202511141407.f9edcfa6-lkp@intel.com
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
