gvisor icon indicating copy to clipboard operation
gvisor copied to clipboard

Do not assume buffer.View boundaries for packet headers

Open ghananigans opened this issue 5 years ago • 7 comments

stack.PacketBuffer.Data is documented to be guaranteed not to contain headers that split across views. However, after a discussion with bhaskerh, this guarantee is not true. As such, we should remove all assumptions about buffer.View boundaries for packet headers.

        // Data holds the payload of the packet. For inbound packets, it also
	// holds the headers, which are consumed as the packet moves up the
	// stack. Headers are guaranteed not to be split across views.
	//
	// The bytes backing Data are immutable, but Data itself may be trimmed
	// or otherwise modified.
	Data buffer.VectorisedView

ghananigans avatar Apr 09 '20 22:04 ghananigans

#2313 helps achieve this

ghananigans avatar Apr 09 '20 22:04 ghananigans

Marking this closed. Will track further work around buffer reuse as separate tasks.

hbhasker avatar Mar 21 '22 18:03 hbhasker

There are TODOs still referencing this issue:

  1. pkg/tcpip/header/parse/parse.go:53: Per RFC 791, IHL needs to be at least 5 in
  2. pkg/tcpip/header/parse/parse.go:179: Figure out whether to reject this kind of

Search TODO

github-actions[bot] avatar Mar 22 '22 00:03 github-actions[bot]

A friendly reminder that this issue had no activity for 120 days.

github-actions[bot] avatar Sep 14 '23 00:09 github-actions[bot]

This issue has been closed due to lack of activity.

github-actions[bot] avatar Dec 13 '23 00:12 github-actions[bot]

There are TODOs still referencing this issue:

  1. pkg/tcpip/header/parse/parse.go:52: Per RFC 791, IHL needs to be at least 5 in
  2. pkg/tcpip/header/parse/parse.go:180: Figure out whether to reject this kind of

Search TODO

github-actions[bot] avatar Dec 14 '23 00:12 github-actions[bot]

A friendly reminder that this issue had no activity for 120 days.

github-actions[bot] avatar Apr 13 '24 00:04 github-actions[bot]