summary refs log tree commit diff
Commit message (Collapse)AuthorAge
* sys_util: make UnixSeqpacket::recv use libc::recv interguestAlyssa Ross2020-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's very surprising that a method called "recv" would end up calling read(). When UnixSeqpacket was introduced in 1d44223f9, the method was called "read", so this behaviour made more sense. It was renamed to "recv" in b7196e2a1, but the implementation was not changed to call libc::recv. In most cases, according to recv(2), the difference between read() and recv() doesn't matter: > The only difference between recv() and read(2) is the presence of > flags. With a zero flags argument, recv() is generally equivalent > to read(2) (but see NOTES). But the NOTES section explains that > If a zero-length datagram is pending, read(2) and recv() with a > flags argument of zero provide different behavior. In this > circumstance, read(2) has no effect (the datagram remains pending), > while recv() consumes the pending datagram. This means that, while we might expect UnixSeqpacket::recv(&mut []) to mirror the behaviour of recv() and discard a message despite the empty buffer, it would actually leave it there. This became relevant when I implemented the startup message queue in 5bd2e7f60, because I used an empty recv to drop the ready message from the socket, since it was only used for polling and I didn't care about the content. But, it turns out that my UnixSeqpacket::recv call did nothing, and left the message on the socket. This wasn't immediately noticeable, but it meant that when a message came through on the control socket later, it would actually get the ready message from UnixSeqpacket::recv, rather than the expected message on the control socket. For example, trying to use crosvm disk resize would print a message like the following: > [ERROR:vm_control/src/lib.rs:649] unexpected disk socket result: Ready > [ERROR:devices/src/virtio/block.rs:334] Attempted to resize read-only block device We can see that it does try to process the received message, but first it tries to do something with the Ready message, which should have been discarded by now. With this fix applied, we can see that it now receives and tries to process the correct message (but then fails because the VM I tested didn't support disk resizing!): > [ERROR:devices/src/virtio/block.rs:334] Attempted to resize read-only block device Fixes: b7196e2a1c1eb7123e7eace5418b7eb4a3e24dbe Fixes: 5bd2e7f606b726b598fdc26fe26a9b4029fab6d3 Cc: Cole Helbling <cole.e.helbling@outlook.com>
* crosvm: make wl add take socket as fdAlyssa Ross2020-07-06
|
* devices: include path in SocketConnect error msgAlyssa Ross2020-07-06
|
* devices: log WlState execute failuresAlyssa Ross2020-07-06
| | | | These were previously just silently discarded.
* devices: unique wl socket name generationAlyssa Ross2020-07-06
|
* Remove VirtioPciDevice debugAlyssa Ross2020-07-02
| | | | This broke sandboxing
* Make wayland socket names byte arraysAlyssa Ross2020-07-02
|
* fix arg checksAlyssa Ross2020-07-02
|
* debugAlyssa Ross2020-07-02
|
* Make lots of things DebugAlyssa Ross2020-07-02
|
* devices: enable adding Wl sockets at runtimeAlyssa Ross2020-07-02
|
* impl MsgOnSocket for PathBufAlyssa Ross2020-06-15
|
* impl MsgOnSocket for StringAlyssa Ross2020-06-15
|
* msg_socket: impl MsgOnSocket for Cow<[T]>Alyssa Ross2020-06-15
| | | | | | | This is unlikely to be directly useful, but it will be helpful for Vec-based types like String and PathBuf to delegate to this implementation for write_to_buffer, since they can't delegate to Vec's without copying.
* msg_socket: make usize fixed sizeAlyssa Ross2020-06-15
| | | | | Seems like an accidental ommission. All other numeric types are fixed-size, and usize is serialized as a u64 anyway.
* Don't build crosvm_*_wlAlyssa Ross2020-06-15
| | | | | We're not going to use these any more, but let's keep the code around for now.
* msg_socket: implement MsgOnSocket for ResultAlyssa Ross2020-06-15
|
* msg_socket: fix derive for empty named structsAlyssa Ross2020-06-15
| | | | | | | | | This wouldn't work before: #[derive(MsgOnSocket)] enum Simple { A {} => {}, }
* more robust memfd serverAlyssa Ross2020-06-15
|
* crosvm: add memfd serverAlyssa Ross2020-06-15
|
* prepare to intercept VM controlAlyssa Ross2020-06-15
|
* three partsAlyssa Ross2020-06-15
|
* msg_socket2: add serialize_newtype_variantAlyssa Ross2020-06-15
|
* make remote wayland device optionalAlyssa Ross2020-06-15
|
* don't assume two queuesAlyssa Ross2020-06-15
|
* send wl::Params over socketAlyssa Ross2020-06-15
|
* use lifetimes in serialization to prevent closingAlyssa Ross2020-06-15
|
* fix docAlyssa Ross2020-06-15
|
* devices: VirtioDeviceNewAlyssa Ross2020-06-15
|
* recursive deserializationAlyssa Ross2020-06-15
|
* recursive serializationAlyssa Ross2020-06-15
|
* SerializerWithFds traitAlyssa Ross2020-06-15
|
* switch from poly_msg_socket to msg_socket2Alyssa Ross2020-06-15
|
* msg_socket2: initial commitAlyssa Ross2020-06-15
|
* debug_labelAlyssa Ross2020-06-15
|
* queue_max_sizesAlyssa Ross2020-06-15
|
* devices: return Vec from queue_max_sizesAlyssa Ross2020-06-15
|
* device_typeAlyssa Ross2020-06-15
|
* featuresAlyssa Ross2020-06-15
|
* get_device_capsAlyssa Ross2020-06-15
|
* get_device_barsAlyssa Ross2020-06-15
|
* be more panickyAlyssa Ross2020-06-15
|
* resetAlyssa Ross2020-06-15
|
* read_configAlyssa Ross2020-06-15
|
* ack_featuresAlyssa Ross2020-06-15
|
* write_configAlyssa Ross2020-06-15
|
* Don't give worker ownership of socketAlyssa Ross2020-06-15
|
* send MemoryParams in createAlyssa Ross2020-06-15
|
* move MemoryParams to devicesAlyssa Ross2020-06-15
|
* poly_msg_socketAlyssa Ross2020-06-15
| | | | we're gonna need this to send all of VirtioDevice over a socket