Re: [v2] vhost: add vsock compat ioctl

6 messages, 3 authors, 2018-03-25 · open the first message on its own page

Re: [v2] vhost: add vsock compat ioctl

From: David Miller <davem@davemloft.net>
Date: 2018-03-16 19:30:20

Although the top level ioctls are probably size and layout compatible,
I do not think that the deeper ioctls can be called by compat binaries
without some translations in order for them to work.

Re: [v2] vhost: add vsock compat ioctl

From: Sonny Rao <hidden>
Date: 2018-03-17 00:54:34

On Fri, Mar 16, 2018 at 12:30 PM, David Miller [off-list ref] wrote:
Although the top level ioctls are probably size and layout compatible,
I do not think that the deeper ioctls can be called by compat binaries
without some translations in order for them to work.
Ok, thanks -- I have only tested VHOST_VSOCK_SET_GUEST_CID and
VHOST_VSOCK_SET_RUNNING but by deeper ioctls I think you might mean
the ioctls under vhost_dev_ioctl() and vhost_vring_ioctl()?

Re: [v2] vhost: add vsock compat ioctl

From: David Miller <davem@davemloft.net>
Date: 2018-03-17 13:24:10

From: Sonny Rao <redacted>
Date: Fri, 16 Mar 2018 17:54:12 -0700
On Fri, Mar 16, 2018 at 12:30 PM, David Miller [off-list ref] wrote:
quoted
Although the top level ioctls are probably size and layout compatible,
I do not think that the deeper ioctls can be called by compat binaries
without some translations in order for them to work.
Ok, thanks -- I have only tested VHOST_VSOCK_SET_GUEST_CID and
VHOST_VSOCK_SET_RUNNING but by deeper ioctls I think you might mean
the ioctls under vhost_dev_ioctl() and vhost_vring_ioctl()?
Yes.

Re: [v2] vhost: add vsock compat ioctl

From: Stefan Hajnoczi <hidden>
Date: 2018-03-22 09:25:36

On Fri, Mar 16, 2018 at 7:30 PM, David Miller [off-list ref] wrote:
Although the top level ioctls are probably size and layout compatible,
I do not think that the deeper ioctls can be called by compat binaries
without some translations in order for them to work.
I audited the vhost ioctl code when reviewing this patch and was
unable to find anything that would break for a 32-bit userspace
process.

drivers/vhost/net.c does the same thing already, which doesn't prove
it's correct but makes me more confident I didn't miss something while
auditing the vhost ioctl code.

Did you have a specific ioctl in mind?

Stefan

Re: [v2] vhost: add vsock compat ioctl

From: Sonny Rao <hidden>
Date: 2018-03-22 20:38:59

On Thu, Mar 22, 2018 at 2:25 AM, Stefan Hajnoczi [off-list ref] wrote:
On Fri, Mar 16, 2018 at 7:30 PM, David Miller [off-list ref] wrote:
quoted
Although the top level ioctls are probably size and layout compatible,
I do not think that the deeper ioctls can be called by compat binaries
without some translations in order for them to work.
I audited the vhost ioctl code when reviewing this patch and was
unable to find anything that would break for a 32-bit userspace
process.

drivers/vhost/net.c does the same thing already, which doesn't prove
it's correct but makes me more confident I didn't miss something while
auditing the vhost ioctl code.

Did you have a specific ioctl in mind?
I think he means that we need to use the compat_ptr macro on any other
pointers we get from userspace in those other ioctls.  For most
architectures this macro doesn't seem to do much but it does on some
-- I think s390 modifies the pointer.
Stefan

Re: [v2] vhost: add vsock compat ioctl

From: David Miller <davem@davemloft.net>
Date: 2018-03-25 20:50:55

From: Stefan Hajnoczi <redacted>
Date: Thu, 22 Mar 2018 09:25:35 +0000
On Fri, Mar 16, 2018 at 7:30 PM, David Miller [off-list ref] wrote:
quoted
Although the top level ioctls are probably size and layout compatible,
I do not think that the deeper ioctls can be called by compat binaries
without some translations in order for them to work.
I audited the vhost ioctl code when reviewing this patch and was
unable to find anything that would break for a 32-bit userspace
process.

drivers/vhost/net.c does the same thing already, which doesn't prove
it's correct but makes me more confident I didn't miss something while
auditing the vhost ioctl code.

Did you have a specific ioctl in mind?
I walked over the vhost ioctl datastructures and they all appear like
they should be compatible.

So I guess it won't be a problem after all.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help