Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1187211pxb; Fri, 13 Nov 2020 06:30:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5rlcGKAXiAGdS6PprERfY5LWXtioYKLjlUZg1nmhwSIHVY9Nl/Z/FesnVHyxonnLzzmCi X-Received: by 2002:aa7:c512:: with SMTP id o18mr2638325edq.357.1605277810404; Fri, 13 Nov 2020 06:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605277810; cv=none; d=google.com; s=arc-20160816; b=et6Z/Fb2BLXUged7GKbdSkUHzoCJMzmG3pSVN3CaXGpjIPEtDsZNWOSDKUipYRJhaZ WLmeL+0ZePq0VLykrUAVqGGehnQGh2FE0mcVyZTqGCYdH2x14wAAhAVi+pA3IYNR9jrB MfobGvrVFRO/BgZKu1ouTq+LzyIfZ/tAkjl939+JuQZj6EO7QXJlCBYby9Lf2Npi9AIX PqhamfhRywRuR2rv4dqChEd+xnuL++CT2kJr0F+sKJcaSAylR9W6R/9BGI5JoGFB5/XP Trw23PkIh/RT3m5dcBhWTFfMFwELdm7hQcmoMJGYFfHcDrZ1lNatdMAVq43npTdGI3PL xd5Q== 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 :message-id:date:subject:cc:to:from; bh=K2VDhoEqljzSMpJT080APVQ0vBKhpHw6h3ZECEgOfzU=; b=JaSSGBprxLrwJ91b/3qdMdEhbnBlb/VPW+Tt6y19T5d/nNFLBj9R4Akxo9f/nn0vvl gQWifG+vgyWHviLLw1W6ADbJuG4hEUkZ30D91wujHNri/wgUZRqueqyMQggU1h2rQTaf oZfOEtTp3dNIJAjH9GSJa66UK9AeZ7au/6/u/WcfIjsoTSBOkd5Z+QVJXlzO/xfmwmPP x9vkV3b3PMuEvlsa7KmNJkKZZBj2LuDY7vec0aHV9dIHW2OaB4Opr94xymlNigqNUGB6 +UiwHyHPsHiOd4C+nsx1g9MDBZSQ4yjEBelH5dbfOtMS03QXAmUhWOtMnONsNEvM1mB7 4T5g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o60si6790330eda.61.2020.11.13.06.29.45; Fri, 13 Nov 2020 06:30:10 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726748AbgKMO21 (ORCPT + 99 others); Fri, 13 Nov 2020 09:28:27 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:7894 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726278AbgKMO20 (ORCPT ); Fri, 13 Nov 2020 09:28:26 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4CXgmn1tP2z75Fv; Fri, 13 Nov 2020 22:28:09 +0800 (CST) Received: from DESKTOP-8RFUVS3.china.huawei.com (10.174.185.179) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Fri, 13 Nov 2020 22:28:08 +0800 From: Zenghui Yu To: , CC: , , , , , , , Zenghui Yu Subject: [PATCH 0/2] KVM: arm64: vgic: Fix handling of userspace register accesses Date: Fri, 13 Nov 2020 22:27:59 +0800 Message-ID: <20201113142801.1659-1-yuzenghui@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.174.185.179] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We had recently seen a kernel panic when accidently programming QEMU in an inappropriate way (in short, accessing RD registers before setting the RD base address. See patch #1 for details). And it looks like we're missing some basic checking when handling userspace register access. I've only tested it with QEMU. It'd be appreciated if others can test it with other user tools. Zenghui Yu (2): KVM: arm64: vgic: Forbid invalid userspace Redistributor accesses KVM: arm64: vgic: Forbid invalid userspace Distributor accesses arch/arm64/kvm/vgic/vgic-mmio-v3.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.19.1