From: Andre Przywara Date: Wed, 8 May 2013 22:28:06 +0000 (+0200) Subject: ARM: KVM: prevent NULL pointer dereferences with KVM VCPU ioctl X-Git-Tag: v3.10-rc5~28^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8180dcaa8470ceca21109f143876fdcd9fe050a;p=pandora-kernel.git 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: Andre Przywara Signed-off-by: Christoffer Dall --- Reading git-diff-tree failed