[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd12a7e25a26a8fb058180a4c0cc9e95ed644153.camel@infradead.org>
Date: Thu, 24 Jun 2021 13:39:34 +0100
From: David Woodhouse <dwmw2@...radead.org>
To: Jason Wang <jasowang@...hat.com>, netdev <netdev@...r.kernel.org>
Cc: Eugenio PĂ©rez <eperezma@...hat.com>
Subject: Re: [PATCH] net: tun: fix tun_xdp_one() for IFF_TUN mode
On Wed, 2021-06-23 at 11:39 +0800, Jason Wang wrote:
> >
> > In the 1:1 mode, the access_ok() is all that's needed since there's no
> > translation.
> >
> > @@ -2038,6 +2065,14 @@ static int translate_desc(struct vhost_virtqueue *vq, u64 addr, u32 len,
> > u64 s = 0;
> > int ret = 0;
> >
> > + if (vhost_has_feature(vq, VHOST_F_IDENTITY_MAPPING)) {
>
>
> Using vhost_has_feature() is kind of tricky since it's used for virtio
> feature negotiation.
>
> We probably need to use backend_features instead.
>
> I think we should probably do more:
>
> 1) forbid the feature to be set when mem table / IOTLB has at least one
> mapping
> 2) forbid the mem table / IOTLB updating after the feature is set
Yes, that all makes sense. I confess I hadn't actually *implemented*
the feature at all; the only time I'd typed 'VHOST_F_IDENTITY_MAPPING'
was to show that snippet of "patch" as an example of what
translate_desc() would do. I just wanted *something* to put in the
'if()' statement as a placeholder, so I used that.
It could *even* have just been 'if (!umem)' but that might let it
happen by *accident* which probably isn't a good idea.
Download attachment "smime.p7s" of type "application/x-pkcs7-signature" (5174 bytes)
Powered by blists - more mailing lists