diff options
author | Rick Edgecombe <rick.p.edgecombe@intel.com> | 2023-07-06 16:38:58 -0700 |
---|---|---|
committer | Dave Hansen <dave.hansen@linux.intel.com> | 2023-08-02 15:01:51 -0700 |
commit | c6b53dcec07c842af75123d9b29684bdbd36a407 (patch) | |
tree | 33567f59d47efd79f97bed34171fae30c1e49194 /arch/x86/hyperv/mmu.c | |
parent | 54acee601b87cfe43e17f6812449e5eb3eab39f9 (diff) |
x86/shstk: Don't retry vm_munmap() on -EINTR
The existing comment around handling vm_munmap() failure when freeing a
shadow stack is wrong. It asserts that vm_munmap() returns -EINTR when
the mmap lock is only being held for a short time, and so the caller
should retry. Based on this wrong understanding, unmap_shadow_stack() will
loop retrying vm_munmap().
What -EINTR actually means in this case is that the process is going
away (see ae79878), and the whole MM will be torn down soon. In order
to facilitate this, the task should not linger in the kernel, but
actually do the opposite. So don't loop in this scenario, just abandon
the operation and let exit_mmap() clean it up. Also, update the comment
to reflect the actual meaning of the error code.
Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20230706233858.446232-1-rick.p.edgecombe%40intel.com
Diffstat (limited to 'arch/x86/hyperv/mmu.c')
0 files changed, 0 insertions, 0 deletions