diff options
| author | Krzysztof Karas <krzysztof.karas@intel.com> | 2026-09-11 06:11:45 +0000 |
|---|---|---|
| committer | Jani Nikula <jani.nikula@intel.com> | 2026-10-06 15:47:14 +0300 |
| commit | ebe162db655881a38de43301151ff7ac940602b5 (patch) | |
| tree | 90dcf9eb1f87a6077590594496e259e25d24bb3f /tools/lib/python | |
| parent | a90ee4305c4a5df72c11b31dacfdc76e00fcf78a (diff) | |
| download | linux-next-ebe162db655881a38de43301151ff7ac940602b5.tar.gz linux-next-ebe162db655881a38de43301151ff7ac940602b5.zip | |
drm/i915/gem: Prevent overstepping exec array boundary
It is possible for eb_relocate_parse_slow() to call kvfree() on
entries outside the original exec array during following
scenario inside eb_relocate_parse_slow():
1) eb_copy_relocations() allocates as many as eb->buffer_count
copies for exec entries;
2) eb_parse() appends up to two VMAs, right after incrementing
eb->buffer_count;
3) cleanup under "out" label uses this incremented buffer_count
to release relocation pointers from exec array via kvfree(),
not from VMA array.
To amend this problem, ensure that relocation cleanup uses the
original exec object count, excluding the VMAs appended by the
command parser.
Fixes: 8e4ba491b0ba ("drm/i915: Parse command buffer earlier in eb_relocate(slow)")
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Assisted-by: GitHub-Copilot:gpt-6-astra
Cc: stable@vger.kernel.org # 5.10+
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patch.msgid.link/20260911061145.3535489-1-krzysztof.karas@intel.com
(cherry picked from commit 2a0158925fb943c7ba8f3216e2734952128defc9)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
