intel: Fix stack overflow in intel_dump_gpu
authorBenjamin Lee <benjamin@computer.surgery>
Sat, 3 Jun 2023 22:53:33 +0000 (15:53 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 6 Jun 2023 11:17:06 +0000 (11:17 +0000)
commit7e9b06f1c6031224935685a841d81aafcf5bedba
treea8f301fec632a98d9662766a57e00aacc8a97872
parentbd88c75d4c83637a2ecb0b1755f171b1adddba52
intel: Fix stack overflow in intel_dump_gpu

Previously, the call to ensure_device_info in the intercepted ioctl
would eventually result in another call to ioctl, recursing until stack
overflow:

 - ioctl (intercepted)
 - ensure_device_info
 - intel_get_device_info_from_fd
 - intel_device_info_i915_get_info_from_fd
 - getparam
 - intel_ioctl
 - ioctl (intercepted)

Signed-off-by: Benjamin Lee <benjamin@computer.surgery>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23418>
src/intel/tools/intel_dump_gpu.c