Skip to content

Drop DATA packets with no payload in homa_add_packet - #19

Closed
Stuartwastaken wants to merge 1 commit into
mainfrom
fix/add-packet-zero-length
Closed

Stuartwastaken wants to merge 1 commit into
mainfrom
fix/add-packet-zero-length

Conversation

@Stuartwastaken

Copy link
Copy Markdown
Owner

homa_softirq only checks that a DATA packet is at least as long as struct homa_data_hdr, so a packet with no payload reaches homa_add_packet. If its offset is msgin.recv_end it takes the sequential path and is queued on msgin.packets, but recv_end and bytes_remaining don't move, so the same offset can be queued again and again until the application drains it or the RPC is reaped. This drops such packets with SKB_DROP_REASON_PKT_TOO_SMALL; sendmsg and homa_message_in_init already reject zero-length messages, so no sender produces them.

The new unit test homa_add_packet__no_data fails without the change (the packet is queued and the return is 0).

A DATA packet with no bytes after its header at offset recv_end took
the sequential path: it was queued on msgin.packets but advanced
neither recv_end nor bytes_remaining, so a peer could queue the same
offset over and over. Senders never generate such packets.
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.

1 participant