From: Michael S. Tsirkin Date: Sun, 16 Sep 2012 08:50:30 +0000 (+0300) Subject: KVM: make processes waiting on vcpu mutex killable X-Git-Tag: omap-for-v3.7-rc1/fixes-cpufreq-signed~15^2~4^2~11 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fc77441e5e1bf80b794cc546d2243ee9f4afb75;p=pandora-kernel.git KVM: make processes waiting on vcpu mutex killable vcpu mutex can be held for unlimited time so taking it with mutex_lock on an ioctl is wrong: one process could be passed a vcpu fd and call this ioctl on the vcpu used by another process, it will then be unkillable until the owner exits. Call mutex_lock_killable instead and return status. Note: mutex_lock_interruptible would be even nicer, but I am not sure all users are prepared to handle EINTR from these ioctls. They might misinterpret it as an error. Cleanup paths expect a vcpu that can't be used by any userspace so this will always succeed - catch bugs by calling BUG_ON. Catch callers that don't check return state by adding __must_check. Signed-off-by: Michael S. Tsirkin Signed-off-by: Marcelo Tosatti --- Reading git-diff-tree failed