[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] alteration of tcp payload



I'm testing a fix for this in :

Several other people have run into it, so we should now just raise an exception when the granted page is not page-aligned on Xen.  The fix will be in a released mirage-platform shortly.

-anil

On 5 Nov 2014, at 15:53, Anil Madhavapeddy <anil@xxxxxxxxxx> wrote:

This will be fixed! Thanks for confirming that it was the issue at hand.

Anil

On 5 Nov 2014, at 15:42, Michael Moon <michaelmoon.pr@xxxxxxxxx> wrote:

Thanks, page-aligned buffer worked.

By the way, I found the following open issue, suggesting fatal error for not-page-aliged buffers:

https://github.com/mirage/mirage-net-xen/issues/10

That suggestion would definitely save developers' time!



On Wed, Nov 5, 2014 at 1:41 PM, Anil Madhavapeddy <anil@xxxxxxxxxx> wrote:
A common reason for this that I think we should check for specifically is how you allocate the buffer.  Because the buffer is passed directly to the network interface, it *must* be allocated via Io_page.get (which can then be turned into a Cstruct).

If you allocate the buffer with Cstruct.create, it will simply be garbage when transmitted as the underlying memory will have the wrong alignment.

In fact, if you create a bug report on https://github.com/mirage/mirage/issues, I'll look into making this check happen.  It's an annoying subtlety in an otherwise type-safe interface.

-anil

On 5 Nov 2014, at 12:56, Michael Moon <michaelmoon.pr@xxxxxxxxx> wrote:


I am sending some data over a tcp connection, and I found that for a xen unikernel, data is changed to some arbitrary bit string of the same length. Looking at netif.ml and writev function, I noticed that tcp packet is split into two pages: first page (first_page variable) contains the headers, and the second page contains the payload. Dumping pages in writev function shows that payload is passed correctly to the function write_request, but tcp_dump on the interface captures a different payload data that looks arbitrary. Even if I modify writev to replace my payload with a string of predefined characters (let us say all zeros), I still observe a different payload coming out of the interface.

Any idea?

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.