Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4751870pxj; Wed, 12 May 2021 12:24:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz82+Ax/DXxgrbUO0WAnMVPKiRaZrfTbvkXitd+OfDqFw5arKoA0nqxY9/u20fsy/LkujeL X-Received: by 2002:a17:906:87d3:: with SMTP id zb19mr39439308ejb.342.1620847470741; Wed, 12 May 2021 12:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620847470; cv=none; d=google.com; s=arc-20160816; b=zHnrGdqyFVAYCKh78i6UzUMXx88ctcSxmOBwgk4MHP3xCtRcA9EdTvrJ9jfUteay2h OrBOp1bUhgMOF6tZhaIjcF3etFgd0ZtUvX7L8nn7Top5N3tPifp8Qx8EoTJpO6QU743t z8QTEE8X+wr+FA2HBQRvwEn0kxVXAx8YIb5p+7o0dlXhX2V2XXtS+z9f8D/Hka99id2k eTtDXo8fcZ2LhqgoZI1KNf9H8EqZiIT5NWaXJ2WhvJFT2ZptSXKKWvvQYcMHWPwQeqQ7 dWg+Xp+ewerYSu4ev9JoAQEn1LVzsFkHpv6XMOSrAa753PgYnfGO9sulbIDUQm4aLON2 PmNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GSm1aEAa/Bg4XLyqJDNAd3FOAdH5sF5zdyc4O3EkbCE=; b=tyld3A5beHFmBV0eex2VZ5OK2KWQzA1vYMoMh1MdrqPijKYnzl2q7JVMJGKNtd2uAd B3kj7EAwcWbOMnWIEAIH3dQqdRvVNMk22N/KAsVh7tdk9OEYfPUxl5FtLeVxXfwPbxSx As3TjEfrF3PSXcKVCGd6L14gp3G5jlLXBIoLCuYC6Xu4BeW4Wv/eTJWhLF4pPPLY8BzK LDjyAYOlCz944hZIIuXFv/9GH3AbcfZZe7hoGMDP4XWO2HMdJ6dUc2tndc5CTBVPOQU6 f0qNdN8KqYpJjS4VvXu9p6uEDqm9CdBAQ4VBBneqd4nqC45MOqdc2SvD1QqnijQiyFNO rDQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vjwElX95; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ox25si244290ejb.739.2021.05.12.12.24.06; Wed, 12 May 2021 12:24:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vjwElX95; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379915AbhELTUb (ORCPT + 99 others); Wed, 12 May 2021 15:20:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:46966 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244797AbhELQvL (ORCPT ); Wed, 12 May 2021 12:51:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3269061C8F; Wed, 12 May 2021 16:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620836350; bh=CGfC9W18/Jox6ympwiH29ypYoRjyQwKxo3cJZuWlpA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vjwElX95GcjLcDIEu04XFv5Yzb2kLvyZjhaeg8kdQMBH59B4hoaWkZ2sgXQBhgaX7 Mm3vWKGN9wgKgMzsSwiHcwtpb+PjMU+iK5bXJe4tmGYkybJZ+zFbBqDjtxn5nnvlBT Eo9ETM8SKjrC5xdy/jRDWRExmO2chl0lI5jpIB9A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Auger , Alexandru Elisei , Marc Zyngier Subject: [PATCH 5.10 104/530] KVM: arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION read Date: Wed, 12 May 2021 16:43:34 +0200 Message-Id: <20210512144823.222352119@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Auger commit 53b16dd6ba5cf64ed147ac3523ec34651d553cb0 upstream. The doc says: "The characteristics of a specific redistributor region can be read by presetting the index field in the attr data. Only valid for KVM_DEV_TYPE_ARM_VGIC_V3" Unfortunately the existing code fails to read the input attr data. Fixes: 04c110932225 ("KVM: arm/arm64: Implement KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION") Cc: stable@vger.kernel.org#v4.17+ Signed-off-by: Eric Auger Reviewed-by: Alexandru Elisei Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20210405163941.510258-3-eric.auger@redhat.com Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kvm/vgic/vgic-kvm-device.c | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/arm64/kvm/vgic/vgic-kvm-device.c +++ b/arch/arm64/kvm/vgic/vgic-kvm-device.c @@ -226,6 +226,9 @@ static int vgic_get_common_attr(struct k u64 addr; unsigned long type = (unsigned long)attr->attr; + if (copy_from_user(&addr, uaddr, sizeof(addr))) + return -EFAULT; + r = kvm_vgic_addr(dev->kvm, type, &addr, false); if (r) return (r == -ENODEV) ? -ENXIO : r;