]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm: stop calling tt_swapin in vm_access
authorMatthew Auld <matthew.auld@intel.com>
Mon, 27 Sep 2021 11:41:02 +0000 (12:41 +0100)
committerChristian König <christian.koenig@amd.com>
Wed, 29 Sep 2021 11:54:06 +0000 (13:54 +0200)
commit358d8465e73b3ce7cebcb3a1427457e09f447ecc
treeaefc8688b1f41ec07d8a361047fcac494a87cfd3
parentbbedea9eac5d4b872a80798b859006c68de708ea
drm/ttm: stop calling tt_swapin in vm_access

In commit:

commit ee167968b82313681f69a13b18fa48ba88acfac6
Author: Felix Kuehling <Felix.Kuehling@amd.com>
Date:   Thu Jul 13 17:01:16 2017 -0400

    drm/ttm: Implement vm_operations_struct.access v2

we added the vm_access hook, where we also directly call tt_swapin for
some reason. If something is swapped-out then the ttm_tt must also be
unpopulated, and since access_kmap should also call tt_populate, if
needed, then swapping-in will already be handled there.

If anything, calling tt_swapin directly here would likely always fail
since the tt->pages won't yet be populated, or worse since the tt->pages
array is never actually cleared in unpopulate this might lead to a nasty
uaf.

Fixes: ee167968b823 ("drm/ttm: Implement vm_operations_struct.access v2")
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Christian König <christian.koenig@amd.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210927114114.152310-1-matthew.auld@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/ttm/ttm_bo_vm.c