diff options
author | Claudio Imbrenda <imbrenda@linux.ibm.com> | 2025-08-25 17:18:30 +0200 |
---|---|---|
committer | Janosch Frank <frankja@linux.ibm.com> | 2025-09-09 08:17:29 +0000 |
commit | 185d903064f8680c2de43514c94fddc0d75ed00a (patch) | |
tree | 514daed8915d14ae35f6c04b5e6ea576b387c517 /scripts/documentation-file-ref-check | |
parent | de4da7bd5c5172f6362b5994f541d830119840dc (diff) |
KVM: s390: Fix incorrect usage of mmu_notifier_register()
If mmu_notifier_register() fails, for example because a signal was
pending, the mmu_notifier will not be registered. But when the VM gets
destroyed, it will get unregistered anyway and that will cause one
extra mmdrop(), which will eventually cause the mm of the process to
be freed too early, and cause a use-after free.
This bug happens rarely, and only when secure guests are involved.
The solution is to check the return value of mmu_notifier_register()
and return it to the caller (ultimately it will be propagated all the
way to userspace). In case of -EINTR, userspace will try again.
Fixes: ca2fd0609b5d ("KVM: s390: pv: add mmu_notifier")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Diffstat (limited to 'scripts/documentation-file-ref-check')
0 files changed, 0 insertions, 0 deletions