From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932416AbdJYJrq (ORCPT ); Wed, 25 Oct 2017 05:47:46 -0400 Received: from foss.arm.com ([217.140.101.70]:35288 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932346AbdJYJrn (ORCPT ); Wed, 25 Oct 2017 05:47:43 -0400 From: Marc Zyngier To: Eric Auger Cc: , , , , , , , , , , Subject: Re: [PATCH v5 04/10] KVM: arm/arm64: vgic-its: Check GITS_BASER Valid bit before saving tables In-Reply-To: <1508767709-15256-5-git-send-email-eric.auger@redhat.com> (Eric Auger's message of "Mon, 23 Oct 2017 16:08:23 +0200") Organization: ARM Ltd References: <1508767709-15256-1-git-send-email-eric.auger@redhat.com> <1508767709-15256-5-git-send-email-eric.auger@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Date: Wed, 25 Oct 2017 10:47:38 +0100 Message-ID: <86tvyneeyt.fsf@arm.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 23 2017 at 4:08:23 pm BST, Eric Auger wrote: > At the moment we don't properly check the GITS_BASER.Valid > bit before saving the collection and device tables. > > On vgic_its_save_collection_table() we use the GITS_BASER gpa > field whereas the Valid bit should be used. > > On vgic_its_save_device_tables() there is no check. This can > cause various bugs, among which a subsequent fault when accessing > the table in guest memory. > > Let's systematically check the Valid bit before doing anything. > > We also uniformize the code between save and restore. > > Signed-off-by: Eric Auger > Reviewed-by: Andre Przywara > Reviewed-by: Christoffer Dall Reviewed-by: Marc Zyngier M. -- Jazz is not dead. It just smells funny.