Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Mar 2020 09:54:39 +0900
From:      Wanpeng Qian <wanpengqian@gmail.com>
To:        John-Mark Gurney <jmg@funkthat.com>
Cc:        FreeBSD virtualization <freebsd-virtualization@freebsd.org>
Subject:   Re: bhyve: passthrough SMART info from host nvme controller
Message-ID:  <CANBJ%2BxQ=EeNu%2B=ieOMd2fnifhwWA8KCW903f2jx8HYTd1pBZkQ@mail.gmail.com>
In-Reply-To: <20200321004938.GO4213@funkthat.com>
References:  <CANBJ%2BxRdvTUHV0PQeBK2y2bCWDi5idqrD-AsHCT02fWkBLzeQQ@mail.gmail.com> <20200318175901.GI4213@funkthat.com> <CANBJ%2BxTVV3gOv7%2B8Qq9Aq1PaHEo=W%2BNMuqMwZCD7uvU80NFLmA@mail.gmail.com> <20200321004938.GO4213@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> But as you point out, the only way to have that happen is to remove
> capsicum, but that would make byhve overall LESS secure.

Yes, Capsicum is a necessary. for now I just don't know how to get around it.

I just think on pci_nvme_init, we get the SMART info from real device.
and return that info when guest query SMART. so it will not update all the time.

This way, guest application that depended on SMART Info will benefit
from this fix.

On Sat, Mar 21, 2020 at 9:49 AM John-Mark Gurney <jmg@funkthat.com> wrote:
>
> Wanpeng Qian wrote this message on Thu, Mar 19, 2020 at 12:09 +0900:
> > > Can't you do what something like pci_passthru.c does in passthru_init,
> > > and open /dev/nvme0 in pci_nvme_init?
> >
> > Yes, you are correct. but that will make /dev/nvme0 keep open all the time.
> > I just thinking when guest fire a logpage command, open the /dev/nvme0
> > and get the SMART info. then close /dev/nvme0.
>
> But as you point out, the only way to have that happen is to remove
> capsicum, but that would make byhve overall LESS secure.
>
> Even if you were able to open /dev/nvme0 at any time after the process
> was locked down, it doesn't provide additional security, as any
> attacker could just open it up, and do the operation...
>
> So, I'm really confused as to what the benefit of not opening it at
> the start is..
>
> > On Thu, Mar 19, 2020 at 2:59 AM John-Mark Gurney <jmg@funkthat.com> wrote:
> > >
> > > Wanpeng Qian wrote this message on Wed, Mar 18, 2020 at 13:05 +0900:
> > > > But currently bhyve has Capsicum capability, I cannot
> > > > open /dev/nvme0 within pci_nvme.c without extra code.
> > > > (currently I just disable the Capsicum capability)
> > > >
> > > > any feedback?
> > >
> > > Can't you do what something like pci_passthru.c does in passthru_init,
> > > and open /dev/nvme0 in pci_nvme_init?
> > >
> > > Or am I missing something?
>
> --
>   John-Mark Gurney                              Voice: +1 415 225 5579
>
>      "All that I will do, has been done, All that I have, has not."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANBJ%2BxQ=EeNu%2B=ieOMd2fnifhwWA8KCW903f2jx8HYTd1pBZkQ>