Skip to content

Commit 760a9a3

Browse files
Alan Coxmatosatti
Alan Cox
authored andcommitted
kvm: Fix nonsense handling of compat ioctl
KVM_SET_SIGNAL_MASK passed a NULL argument leaves the on stack signal sets uninitialized. It then passes them through to kvm_vcpu_ioctl_set_sigmask. We should be passing a NULL in this case not translated garbage. Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
1 parent 9acb172 commit 760a9a3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

virt/kvm/kvm_main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,9 +1976,10 @@ static long kvm_vcpu_compat_ioctl(struct file *filp,
19761976
if (copy_from_user(&csigset, sigmask_arg->sigset,
19771977
sizeof csigset))
19781978
goto out;
1979-
}
1980-
sigset_from_compat(&sigset, &csigset);
1981-
r = kvm_vcpu_ioctl_set_sigmask(vcpu, &sigset);
1979+
sigset_from_compat(&sigset, &csigset);
1980+
r = kvm_vcpu_ioctl_set_sigmask(vcpu, &sigset);
1981+
} else
1982+
r = kvm_vcpu_ioctl_set_sigmask(vcpu, NULL);
19821983
break;
19831984
}
19841985
default:

0 commit comments

Comments
 (0)