Skip to content

Don't split IP-reassembled packets in homa_softirq - #155

Closed
Stuartwastaken wants to merge 1 commit into
PlatformLab:mainfrom
Stuartwastaken:fix/softirq-frag-list
Closed

Stuartwastaken wants to merge 1 commit into
PlatformLab:mainfrom
Stuartwastaken:fix/softirq-frag-list

Conversation

@Stuartwastaken

Copy link
Copy Markdown
Contributor

homa_softirq treats any frag_list as a batch from Homa's GRO, but IP reassembly also builds one when a Homa packet arrives in fragments. The fragments then get dispatched as separate Homa packets with skb->dev == NULL, so dev_net() faults in homa_dispatch_pkts. Any remote host can trigger this, and in the stripped build (no GRO) a frag_list can only come from reassembly.

Reassembly counts the fragments in skb->len and Homa's GRO doesn't, so this only splits the list when skb->len == skb_pagelen(skb). The new unit test homa_softirq__frag_list_from_ip_reassembly crashes in dev_net under ASan without the fix; all 887 unit tests pass with it.

homa_softirq assumed that any frag_list was a batch built by Homa's
GRO and processed each entry as a separate Homa packet. IP reassembly
also leaves fragments on frag_list, and those are pieces of one
packet: their bytes are counted in the head's len, their payload was
parsed as Homa headers, and their dev is NULL, so dev_net crashed in
homa_dispatch_pkts. Any remote host can send fragmented Homa packets,
and in the stripped build, which has no GRO, every frag_list comes
from reassembly.

Homa's GRO doesn't add batched packets to the head's len, so split
the list only when skb->len == skb_pagelen(skb).
@johnousterhout

Copy link
Copy Markdown
Member

I don't this fix will work: I think there are other problems that will prevent Homa from correctly handling IP-fragmented packets. For example, Homa's GRO assumes it "owns" the frag list to use for collecting batches, so if the head packet is actually IP-fragmented I suspect that GRO will append additional full packets onto the end of the fragment list.

I don't think it's worth Homa's trying to handle fragmented packets (I don't believe that TCP does this either). I believe there are ways to tell the IP stack "do not ever fragment this packet", but Homa doesn't currently attempt to do this. I've added this to notes.txt as a future task; it probably makes sense to wait until after the UDP conversion is complete so the fix can be done in that context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants