Skip to content

upload-pack: handle unexpected v2 delim packets

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2test-lib-functions: make packetize() more efficientt/t5562-http-backend-content-length.sh t/test-lib-functions.sh+28 -1411 replies
2/2upload-pack: handle unexpected delim packetsls-refs.c t/t5704-protocol-violations.sh upload-pack.c+41 -21 reply

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchTaylor BlauJeff King
SeriesR-b
1/2Helped-by
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] upload-pack: handle unexpected v2 delim packets

We saw an upload-pack segfault in the wild today at GitHub. It's caused by a client sending bogus v2 protocol lines (a "delim" packet instead of a "flush"). So the client is broken and our only option is to break the network connection, but we shouldn't segfault while doing so. :)

I don't think the broken client was Git. It didn't send an "agent" capability at all, which makes me suspect it was somebody generating the request manually (nor was there anything interesting in the transport layer agent; it was just an openssh client).

The fix was simple enough, and is in the second patch. The first one is just a small cleanup / refactor in preparation.

[1/2]: test-lib-functions: make packetize() more efficient [2/2]: upload-pack: handle unexpected delim packets

 ls-refs.c                              |  5 +++-
 t/t5562-http-backend-content-length.sh | 19 +++++++++------
 t/t5704-protocol-violations.sh         | 33 ++++++++++++++++++++++++++
 t/test-lib-functions.sh                | 23 ++++++++++++------
 upload-pack.c                          |  5 +++-
 5 files changed, 69 insertions(+), 16 deletions(-)
 create mode 100755 t/t5704-protocol-violations.sh

-Peff