Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Aug 2019 11:16:12 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Eugene Grosbein <eugen@grosbein.net>, Bruce Evans <brde@optusnet.com.au>,  Freebsd hackers list <freebsd-hackers@freebsd.org>
Subject:   Re: FreeBSD Security Advisory FreeBSD-SA-19:23.midi
Message-ID:  <CANCZdfpFPO-a-QJsLc_qHU9W5JKpWmk1NHS6Ek0BpvrDTv9=Jw@mail.gmail.com>
In-Reply-To: <a3977237-3f24-ecb9-4399-c8d8fedc26ea@FreeBSD.org>
References:  <20190820201257.7A9D41F8B7@freefall.freebsd.org> <f19d3f62-940c-7888-b379-f416dfc45cac@grosbein.net> <20190830133855.W1405@besplex.bde.org> <5961a5af-d36c-4b8f-20c1-e7054b0149f4@grosbein.net> <a3977237-3f24-ecb9-4399-c8d8fedc26ea@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 30, 2019 at 10:06 AM John Baldwin <jhb@freebsd.org> wrote:

> On 8/30/19 12:56 AM, Eugene Grosbein wrote:
> > 30.08.2019 11:03, Bruce Evans wrote:
> >
> >> The patch preserves some historical mistakes and adds some excessive
> >> verboseness about probe failures.  I'm still waiting for jhb to reply to
> >> mails on 30 Oct 2015 and 23 Jan 2018 asking for a review of this patch
> >> or better a complete fix.
> >
> > Hmm... Maybe additional notification worth it :-)
>
> Hmm, I've used 'hint.foo.0.disabled=1' with many devices and it works fine.
> devctl enable can "undo" the disable post-boot even.
>
> It doesn't disable probing, only attaching once we know which driver a
> device
> is going to use.  As far as I can tell, the patch makes it disable
> DEVICE_PROBE as well, but the vast majority of DEVICE_PROBE routines are
> idempotent.  Only a handful of legacy ISA drivers use 'return (0)' to try
> to
> pass state from probe to attach via the softc.  Those drivers could choose
> to
> check the disabled flag in their probe routine and/or be fixed to have
> idempotent probe routines.  I think the latter is probably the best path
> forward.
>

The problem with disabling before PROBE is that if you have N foo devices,
hint.foo.0.disabled=1 will disable all of them as the probe routines all
return 'not me' and we try foo0 on each new instance... I'm pretty sure
that's why it's not done today and why I didn't do it when I added this
feature because how do you know you have foo0 until probe says 'yup, that's
mine'?

Most of the old ISA routines that returned 0 I think have been deleted.
Maybe all since they were for fussy hardware from before the plug and play
era...

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfpFPO-a-QJsLc_qHU9W5JKpWmk1NHS6Ek0BpvrDTv9=Jw>