Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e8180dca authored by Andre Przywara's avatar Andre Przywara Committed by Gleb Natapov
Browse files

ARM: KVM: prevent NULL pointer dereferences with KVM VCPU ioctl



Some ARM KVM VCPU ioctls require the vCPU to be properly initialized
with the KVM_ARM_VCPU_INIT ioctl before being used with further
requests. KVM_RUN checks whether this initialization has been
done, but other ioctls do not.
Namely KVM_GET_REG_LIST will dereference an array with index -1
without initialization and thus leads to a kernel oops.
Fix this by adding checks before executing the ioctl handlers.

 [ Removed superflous comment from static function - Christoffer ]

Changes from v1:
 * moved check into a static function with a meaningful name

Signed-off-by: default avatarAndre Przywara <andre.przywara@linaro.org>
Signed-off-by: default avatarChristoffer Dall <cdall@cs.columbia.edu>
parent ed829857
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment