Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1684654

Re: [PATCH v3 7/9] vfio: Use driver_override to avert binding to compromising drivers

From Alex Williamson <alex.williamson@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 7/9] vfio: Use driver_override to avert binding to compromising drivers
Date 2017-07-10 23:40 +0200
Message-ID <u1Ozn-1TO-11@gated-at.bofh.it> (permalink)
References <tUtzH-238-5@gated-at.bofh.it> <tUtzJ-238-41@gated-at.bofh.it> <tWybV-qo-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 26 Jun 2017 10:08:55 +0100
Russell King - ARM Linux <linux@armlinux.org.uk> wrote:

> 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?

Well, it seemed like a good idea, but I don't think we're getting any
traction here, the thread has gone cold:

https://lkml.org/lkml/2017/6/27/1002

Greg, any further comments?
 
> 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.

As an alternative, I think we can make this not racy.  BIND_DRIVER is
notified through device_bind_driver() which specifies that the device
lock is held.  This covers not only BIND_DRIVER, but also BOUND_DRIVER
and DRIVER_NOT_BOUND.  So if the user entry points in sysfs were to
require the device lock, we could easily mangle and de-mangle without
interference from a user.  It also seems like a rather good idea in
general to exclude the user from changing driver_override while we're
evaluating a match using it.  Do you still have an objection to
mangling driver_override if we can avoid the user race?  Thanks,

Alex

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v3 7/9] vfio: Use driver_override to avert binding to  compromising drivers Alex Williamson <alex.williamson@redhat.com> - 2017-07-10 23:40 +0200
  Re: [PATCH v3 7/9] vfio: Use driver_override to avert binding to  compromising drivers Greg KH <greg@kroah.com> - 2017-07-11 11:50 +0200
    Re: [PATCH v3 7/9] vfio: Use driver_override to avert binding to  compromising drivers Alex Williamson <alex.williamson@redhat.com> - 2017-07-11 18:50 +0200
      Re: [PATCH v3 7/9] vfio: Use driver_override to avert binding to  compromising drivers Greg KH <greg@kroah.com> - 2017-07-13 10:30 +0200
        Re: [PATCH v3 7/9] vfio: Use driver_override to avert binding to  compromising drivers Alex Williamson <alex.williamson@redhat.com> - 2017-07-14 18:10 +0200
          Re: [PATCH v3 7/9] vfio: Use driver_override to avert binding to  compromising drivers Greg KH <greg@kroah.com> - 2017-07-14 22:10 +0200

csiph-web