From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751855AbdFZJJO (ORCPT ); Mon, 26 Jun 2017 05:09:14 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:43440 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751403AbdFZJJF (ORCPT ); Mon, 26 Jun 2017 05:09:05 -0400 Date: Mon, 26 Jun 2017 10:08:55 +0100 From: Russell King - ARM Linux To: Alex Williamson , Greg KH Cc: kvm@vger.kernel.org, eric.auger@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 7/9] vfio: Use driver_override to avert binding to compromising drivers Message-ID: <20170626090854.GE4902@n2100.armlinux.org.uk> References: <20170620154312.17487.66916.stgit@gimli.home> <20170620154830.17487.1861.stgit@gimli.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170620154830.17487.1861.stgit@gimli.home> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 20, 2017 at 09:48:31AM -0600, Alex Williamson wrote: > If a device is bound to a non-vfio, non-whitelisted driver while a > group is in use, then the integrity of the group is compromised and > will result in hitting a BUG_ON. This code tries to avoid this case > by mangling driver_override to force a no-match for the driver. The > driver-core will either follow-up with a DRIVER_NOT_BOUND (preferred) > or BOUND_DRIVER, at which point we can remove the driver_override > mangling. Rather than mangling the driver override string to prevent driver binding, I wonder if it would make more sense to allow the BUS_NOTIFY_BIND_DRIVER notifier to fail the device probe? The driver override strings are, after all, exposed to userspace, and it strikes me that this kind of mangling is racy - userspace can read or change the override string at any time. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.