linux/drivers/gpu/drm/panfrost
Robin Murphy f70744c687 drm/panfrost: Don't dereference bogus MMU pointers
It seems that killing an application while faults are occurring
(particularly with a GPU in FPGA at a whopping 40MHz) can lead to
handling a lingering page fault after all the address space contexts
have already been freed. In this situation, the LRU list is empty so
addr_to_drm_mm_node() ends up dereferencing the list head as if it were
a struct panfrost_mmu entry; this leaves "mmu->as" actually pointing at
the pfdev->alloc_mask bitmap, which is also empty, and given that the
fault has a high likelihood of being in AS0, hilarity ensues.

Sadly, the cleanest solution seems to involve another goto. Oh well, at
least it's robust...

Fixes: 65e51e30d8 ("drm/panfrost: Prevent race when handling page fault")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/9a0b09e6b5851f0d4428b72dd6b8b4c0d0ef4206.1572293305.git.robin.murphy@arm.com
2019-10-29 13:18:17 -05:00
..
Kconfig drm/panfrost: Require the simple_ondemand governor 2019-06-10 09:30:34 -06:00
Makefile drm/panfrost: Add madvise and shrinker support 2019-08-08 15:57:36 -06:00
panfrost_devfreq.c drm/panfrost: Remove NULL checks for regulator 2019-09-19 11:45:44 -05:00
panfrost_devfreq.h drm/panfrost: Remove opp table when unloading 2019-08-19 11:38:51 -05:00
panfrost_device.c drm/panfrost: Fix regulator_get_optional() misuse 2019-09-19 11:45:44 -05:00
panfrost_device.h drm/panfrost: Remove unnecessary hwaccess_lock spin_lock 2019-08-30 09:53:52 -05:00
panfrost_drv.c panfrost: Properly undo pm_runtime_enable when deferring a probe 2019-10-23 12:50:47 -05:00
panfrost_features.h
panfrost_gem_shrinker.c drm/panfrost: Use mutex_trylock in panfrost_gem_purge 2019-08-28 10:02:39 -05:00
panfrost_gem.c drm/panfrost: Fix sleeping while atomic in panfrost_gem_open 2019-08-22 20:44:19 -05:00
panfrost_gem.h drm/panfrost: Implement per FD address spaces 2019-08-19 11:34:57 -05:00
panfrost_gpu.c drm/panfrost: Add missing GPU feature registers 2019-10-14 13:46:48 -05:00
panfrost_gpu.h
panfrost_issues.h
panfrost_job.c drm/panfrost: Handle resetting on timeout better 2019-10-15 11:38:22 -05:00
panfrost_job.h
panfrost_mmu.c drm/panfrost: Don't dereference bogus MMU pointers 2019-10-29 13:18:17 -05:00
panfrost_mmu.h drm/panfrost: Implement per FD address spaces 2019-08-19 11:34:57 -05:00
panfrost_perfcnt.c drm/panfrost: fix -Wmissing-prototypes warnings 2019-10-29 13:08:20 -05:00
panfrost_perfcnt.h drm/panfrost: Expose performance counters through unstable ioctls 2019-06-18 09:23:48 -06:00
panfrost_regs.h drm/panfrost: Expose performance counters through unstable ioctls 2019-06-18 09:23:48 -06:00
TODO drm/panfrost: Implement per FD address spaces 2019-08-19 11:34:57 -05:00