From: Jason Wang <hidden> Date: 2018-06-08 03:50:56
This feature bit is duplicated with VIRTIO_F_ANY_LAYOUT, this means if
a userpsace want to enable VRITIO_F_ANY_LAYOUT,
VHOST_NET_F_VIRTIO_NET_HDR will be implied too. This is wrong and will
break networking. Fixing this by safely removing
VHOST_NET_F_VIRTIO_NET_HDR support. There should be very few or even
no userspace can use this. Further cleanups could be done for
-net-next for safety.
In the future, we need a vhost dedicated feature set/get ioctl()
instead of reusing virtio ones.
Fixes: 4e9fa50c6ccbe ("vhost: move features to core")
Signed-off-by: Jason Wang <redacted>
---
drivers/vhost/net.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2018-06-08 04:46:48
On Fri, Jun 08, 2018 at 11:50:42AM +0800, Jason Wang wrote:
This feature bit is duplicated with VIRTIO_F_ANY_LAYOUT, this means if
a userpsace want to enable VRITIO_F_ANY_LAYOUT,
VHOST_NET_F_VIRTIO_NET_HDR will be implied too. This is wrong and will
break networking.
What breaks networking exactly? VHOST_NET supported ANY_LAYOUT
from day one. For this reason it does not need to know about
VRITIO_F_ANY_LAYOUT and we reused the bit for other purposes.
Fixing this by safely removing
VHOST_NET_F_VIRTIO_NET_HDR support. There should be very few or even
no userspace can use this.
Quite possibly, but it is hard to be sure. It seems safer to
maintain it unless there's an actual reason something's broken.
Further cleanups could be done for
-net-next for safety.
In the future, we need a vhost dedicated feature set/get ioctl()
instead of reusing virtio ones.
Not just in the future, we might want to switch iommu
to a sane structure without the 64 bit padding bug
right now.
Fixes: 4e9fa50c6ccbe ("vhost: move features to core")
This tag makes no sense here IMHO. Looks like people are using some tool
that just looks at the earliest version where patch won't apply. The
commit in question just moved some code around.
quoted hunk
Signed-off-by: Jason Wang <redacted>
---
drivers/vhost/net.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
From: Jason Wang <hidden> Date: 2018-06-08 05:07:19
On 2018年06月08日 12:46, Michael S. Tsirkin wrote:
On Fri, Jun 08, 2018 at 11:50:42AM +0800, Jason Wang wrote:
quoted
This feature bit is duplicated with VIRTIO_F_ANY_LAYOUT, this means if
a userpsace want to enable VRITIO_F_ANY_LAYOUT,
VHOST_NET_F_VIRTIO_NET_HDR will be implied too. This is wrong and will
break networking.
What breaks networking exactly? VHOST_NET supported ANY_LAYOUT
from day one. For this reason it does not need to know about
VRITIO_F_ANY_LAYOUT and we reused the bit for other purposes.
It's the knowledge of vhost_net code it self but not userspace. For
userspace, it should depends on the value of returned by
VHOST_GET_FEATURES. So when userspace can set_features with ANY_LAYOUT,
vhost may think it wants VHOST_NET_F_VIRTIO_NET_HDR.
quoted
Fixing this by safely removing
VHOST_NET_F_VIRTIO_NET_HDR support. There should be very few or even
no userspace can use this.
Quite possibly, but it is hard to be sure. It seems safer to
maintain it unless there's an actual reason something's broken.
I think not since the feature is negotiated not mandatory?
quoted
Further cleanups could be done for
-net-next for safety.
In the future, we need a vhost dedicated feature set/get ioctl()
instead of reusing virtio ones.
Not just in the future, we might want to switch iommu
to a sane structure without the 64 bit padding bug
right now.
Yes, I hit this bug when introducing V2 of msg IOTLB message.
quoted
Fixes: 4e9fa50c6ccbe ("vhost: move features to core")
This tag makes no sense here IMHO. Looks like people are using some tool
that just looks at the earliest version where patch won't apply. The
commit in question just moved some code around.
Looks not, before this commit, vhost_net won't return ANY_LAYOUT.
Thanks
quoted
Signed-off-by: Jason Wang <redacted>
---
drivers/vhost/net.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2018-06-11 02:12:26
On Fri, Jun 08, 2018 at 01:07:09PM +0800, Jason Wang wrote:
On 2018年06月08日 12:46, Michael S. Tsirkin wrote:
quoted
On Fri, Jun 08, 2018 at 11:50:42AM +0800, Jason Wang wrote:
quoted
This feature bit is duplicated with VIRTIO_F_ANY_LAYOUT, this means if
a userpsace want to enable VRITIO_F_ANY_LAYOUT,
VHOST_NET_F_VIRTIO_NET_HDR will be implied too. This is wrong and will
break networking.
What breaks networking exactly? VHOST_NET supported ANY_LAYOUT
from day one. For this reason it does not need to know about
VRITIO_F_ANY_LAYOUT and we reused the bit for other purposes.
It's the knowledge of vhost_net code it self but not userspace. For
userspace, it should depends on the value of returned by VHOST_GET_FEATURES.
So when userspace can set_features with ANY_LAYOUT, vhost may think it wants
VHOST_NET_F_VIRTIO_NET_HDR.
Yes but that's the admittedly ugly API that we have now.
userspace is supposed to know VRITIO_F_ANY_LAYOUT does
not make sense for vhost.
quoted
quoted
Fixing this by safely removing
VHOST_NET_F_VIRTIO_NET_HDR support. There should be very few or even
no userspace can use this.
Quite possibly, but it is hard to be sure. It seems safer to
maintain it unless there's an actual reason something's broken.
I think not since the feature is negotiated not mandatory?
That doesn't mean much.
quoted
quoted
Further cleanups could be done for
-net-next for safety.
In the future, we need a vhost dedicated feature set/get ioctl()
instead of reusing virtio ones.
Not just in the future, we might want to switch iommu
to a sane structure without the 64 bit padding bug
right now.
Yes, I hit this bug when introducing V2 of msg IOTLB message.
Sounds good, so if you like, reserve a bit for
VHOST_NET_F_VIRTIO_NET_HDR in the new ioctl mask and
do not enable it there.
quoted
quoted
Fixes: 4e9fa50c6ccbe ("vhost: move features to core")
This tag makes no sense here IMHO. Looks like people are using some tool
that just looks at the earliest version where patch won't apply. The
commit in question just moved some code around.
Looks not, before this commit, vhost_net won't return ANY_LAYOUT.
Thanks
Well ANY_LAYOUT just happens to be same as VHOST_NET_F_VIRTIO_NET_HDR
and that has been set since forever.
quoted
quoted
Signed-off-by: Jason Wang <redacted>
---
drivers/vhost/net.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
From: Jason Wang <hidden> Date: 2018-06-11 02:29:48
On 2018年06月11日 10:12, Michael S. Tsirkin wrote:
On Fri, Jun 08, 2018 at 01:07:09PM +0800, Jason Wang wrote:
quoted
On 2018年06月08日 12:46, Michael S. Tsirkin wrote:
quoted
On Fri, Jun 08, 2018 at 11:50:42AM +0800, Jason Wang wrote:
quoted
This feature bit is duplicated with VIRTIO_F_ANY_LAYOUT, this means if
a userpsace want to enable VRITIO_F_ANY_LAYOUT,
VHOST_NET_F_VIRTIO_NET_HDR will be implied too. This is wrong and will
break networking.
What breaks networking exactly? VHOST_NET supported ANY_LAYOUT
from day one. For this reason it does not need to know about
VRITIO_F_ANY_LAYOUT and we reused the bit for other purposes.
It's the knowledge of vhost_net code it self but not userspace. For
userspace, it should depends on the value of returned by VHOST_GET_FEATURES.
So when userspace can set_features with ANY_LAYOUT, vhost may think it wants
VHOST_NET_F_VIRTIO_NET_HDR.
Yes but that's the admittedly ugly API that we have now.
userspace is supposed to know VRITIO_F_ANY_LAYOUT does
not make sense for vhost.
Ok.
quoted
quoted
quoted
Fixing this by safely removing
VHOST_NET_F_VIRTIO_NET_HDR support. There should be very few or even
no userspace can use this.
Quite possibly, but it is hard to be sure. It seems safer to
maintain it unless there's an actual reason something's broken.
I think not since the feature is negotiated not mandatory?
That doesn't mean much.
quoted
quoted
quoted
Further cleanups could be done for
-net-next for safety.
In the future, we need a vhost dedicated feature set/get ioctl()
instead of reusing virtio ones.
Not just in the future, we might want to switch iommu
to a sane structure without the 64 bit padding bug
right now.
Yes, I hit this bug when introducing V2 of msg IOTLB message.
Sounds good, so if you like, reserve a bit for
VHOST_NET_F_VIRTIO_NET_HDR in the new ioctl mask and
do not enable it there.
Ok, and maybe VHOST_F_LOG_ALL.
quoted
quoted
quoted
Fixes: 4e9fa50c6ccbe ("vhost: move features to core")
This tag makes no sense here IMHO. Looks like people are using some tool
that just looks at the earliest version where patch won't apply. The
commit in question just moved some code around.
Looks not, before this commit, vhost_net won't return ANY_LAYOUT.
Thanks
Well ANY_LAYOUT just happens to be same as VHOST_NET_F_VIRTIO_NET_HDR
and that has been set since forever.
So do you still want this patch? If not we need to document that
ANY_LAYOUT could not be passed through SET_FEATURES somewhere.
Thanks
quoted
quoted
quoted
Signed-off-by: Jason Wang <redacted>
---
drivers/vhost/net.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2018-06-11 03:08:48
On Mon, Jun 11, 2018 at 10:29:36AM +0800, Jason Wang wrote:
On 2018年06月11日 10:12, Michael S. Tsirkin wrote:
quoted
On Fri, Jun 08, 2018 at 01:07:09PM +0800, Jason Wang wrote:
quoted
On 2018年06月08日 12:46, Michael S. Tsirkin wrote:
quoted
On Fri, Jun 08, 2018 at 11:50:42AM +0800, Jason Wang wrote:
quoted
This feature bit is duplicated with VIRTIO_F_ANY_LAYOUT, this means if
a userpsace want to enable VRITIO_F_ANY_LAYOUT,
VHOST_NET_F_VIRTIO_NET_HDR will be implied too. This is wrong and will
break networking.
What breaks networking exactly? VHOST_NET supported ANY_LAYOUT
from day one. For this reason it does not need to know about
VRITIO_F_ANY_LAYOUT and we reused the bit for other purposes.
It's the knowledge of vhost_net code it self but not userspace. For
userspace, it should depends on the value of returned by VHOST_GET_FEATURES.
So when userspace can set_features with ANY_LAYOUT, vhost may think it wants
VHOST_NET_F_VIRTIO_NET_HDR.
Yes but that's the admittedly ugly API that we have now.
userspace is supposed to know VRITIO_F_ANY_LAYOUT does
not make sense for vhost.
Ok.
quoted
quoted
quoted
quoted
Fixing this by safely removing
VHOST_NET_F_VIRTIO_NET_HDR support. There should be very few or even
no userspace can use this.
Quite possibly, but it is hard to be sure. It seems safer to
maintain it unless there's an actual reason something's broken.
I think not since the feature is negotiated not mandatory?
That doesn't mean much.
quoted
quoted
quoted
Further cleanups could be done for
-net-next for safety.
In the future, we need a vhost dedicated feature set/get ioctl()
instead of reusing virtio ones.
Not just in the future, we might want to switch iommu
to a sane structure without the 64 bit padding bug
right now.
Yes, I hit this bug when introducing V2 of msg IOTLB message.
Sounds good, so if you like, reserve a bit for
VHOST_NET_F_VIRTIO_NET_HDR in the new ioctl mask and
do not enable it there.
Ok, and maybe VHOST_F_LOG_ALL.
quoted
quoted
quoted
quoted
Fixes: 4e9fa50c6ccbe ("vhost: move features to core")
This tag makes no sense here IMHO. Looks like people are using some tool
that just looks at the earliest version where patch won't apply. The
commit in question just moved some code around.
Looks not, before this commit, vhost_net won't return ANY_LAYOUT.
Thanks
Well ANY_LAYOUT just happens to be same as VHOST_NET_F_VIRTIO_NET_HDR
and that has been set since forever.
So do you still want this patch? If not we need to document that ANY_LAYOUT
could not be passed through SET_FEATURES somewhere.
Thanks
Let's document this, yes. I don't think we should drop
VHOST_NET_F_VIRTIO_NET_HDR now.
quoted
quoted
quoted
quoted
Signed-off-by: Jason Wang <redacted>
---
drivers/vhost/net.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
From: David Miller <davem@davemloft.net> Date: 2018-06-10 19:27:56
From: Jason Wang <redacted>
Date: Fri, 8 Jun 2018 11:50:42 +0800
This feature bit is duplicated with VIRTIO_F_ANY_LAYOUT, this means if
a userpsace want to enable VRITIO_F_ANY_LAYOUT,
VHOST_NET_F_VIRTIO_NET_HDR will be implied too. This is wrong and will
break networking. Fixing this by safely removing
VHOST_NET_F_VIRTIO_NET_HDR support. There should be very few or even
no userspace can use this. Further cleanups could be done for
-net-next for safety.
In the future, we need a vhost dedicated feature set/get ioctl()
instead of reusing virtio ones.
Fixes: 4e9fa50c6ccbe ("vhost: move features to core")
Signed-off-by: Jason Wang <redacted>
I don't see this discussion as resolved yet so I'll mark this
as Deferred in patchwork.
Thanks.