]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Handle SRCU initialization failure during page track init
authorHaimin Zhang <tcs_kernel@tencent.com>
Fri, 3 Sep 2021 02:37:06 +0000 (10:37 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Sep 2021 14:33:09 +0000 (10:33 -0400)
commit57c08d7092a8179157eade6b6be4e8a3a8c9f252
treed9bf754f850145f0268049a1b291ab385f0005c8
parentfa2e02a44682e7b9db1143c7042f24b7875bd26c
KVM: x86: Handle SRCU initialization failure during page track init

Check the return of init_srcu_struct(), which can fail due to OOM, when
initializing the page track mechanism.  Lack of checking leads to a NULL
pointer deref found by a modified syzkaller.

Reported-by: TCS Robot <tcs_robot@tencent.com>
Signed-off-by: Haimin Zhang <tcs_kernel@tencent.com>
Message-Id: <1630636626-12262-1-git-send-email-tcs_kernel@tencent.com>
[Move the call towards the beginning of kvm_arch_init_vm. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_page_track.h
arch/x86/kvm/mmu/page_track.c
arch/x86/kvm/x86.c