netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [v2] vhost: add vsock compat ioctl
@ 2018-03-16 19:30 David Miller
  2018-03-17  0:54 ` Sonny Rao
  2018-03-22  9:25 ` Stefan Hajnoczi
  0 siblings, 2 replies; 6+ messages in thread
From: David Miller @ 2018-03-16 19:30 UTC (permalink / raw)
  To: sonnyrao; +Cc: netdev


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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2] vhost: add vsock compat ioctl
  2018-03-16 19:30 [v2] vhost: add vsock compat ioctl David Miller
@ 2018-03-17  0:54 ` Sonny Rao
  2018-03-17 13:24   ` David Miller
  2018-03-22  9:25 ` Stefan Hajnoczi
  1 sibling, 1 reply; 6+ messages in thread
From: Sonny Rao @ 2018-03-17  0:54 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Fri, Mar 16, 2018 at 12:30 PM, David Miller <davem@davemloft.net> 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()?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2] vhost: add vsock compat ioctl
  2018-03-17  0:54 ` Sonny Rao
@ 2018-03-17 13:24   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2018-03-17 13:24 UTC (permalink / raw)
  To: sonnyrao; +Cc: netdev

From: Sonny Rao <sonnyrao@chromium.org>
Date: Fri, 16 Mar 2018 17:54:12 -0700

> On Fri, Mar 16, 2018 at 12:30 PM, David Miller <davem@davemloft.net> 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()?

Yes.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2] vhost: add vsock compat ioctl
  2018-03-16 19:30 [v2] vhost: add vsock compat ioctl David Miller
  2018-03-17  0:54 ` Sonny Rao
@ 2018-03-22  9:25 ` Stefan Hajnoczi
  2018-03-22 20:38   ` Sonny Rao
  2018-03-25 20:50   ` David Miller
  1 sibling, 2 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2018-03-22  9:25 UTC (permalink / raw)
  To: David Miller; +Cc: sonnyrao, netdev

On Fri, Mar 16, 2018 at 7:30 PM, David Miller <davem@davemloft.net> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2] vhost: add vsock compat ioctl
  2018-03-22  9:25 ` Stefan Hajnoczi
@ 2018-03-22 20:38   ` Sonny Rao
  2018-03-25 20:50   ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: Sonny Rao @ 2018-03-22 20:38 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: David Miller, netdev

On Thu, Mar 22, 2018 at 2:25 AM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Fri, Mar 16, 2018 at 7:30 PM, David Miller <davem@davemloft.net> 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?

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v2] vhost: add vsock compat ioctl
  2018-03-22  9:25 ` Stefan Hajnoczi
  2018-03-22 20:38   ` Sonny Rao
@ 2018-03-25 20:50   ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2018-03-25 20:50 UTC (permalink / raw)
  To: stefanha; +Cc: sonnyrao, netdev

From: Stefan Hajnoczi <stefanha@gmail.com>
Date: Thu, 22 Mar 2018 09:25:35 +0000

> On Fri, Mar 16, 2018 at 7:30 PM, David Miller <davem@davemloft.net> 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?

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-25 20:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-16 19:30 [v2] vhost: add vsock compat ioctl David Miller
2018-03-17  0:54 ` Sonny Rao
2018-03-17 13:24   ` David Miller
2018-03-22  9:25 ` Stefan Hajnoczi
2018-03-22 20:38   ` Sonny Rao
2018-03-25 20:50   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).