<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/upload-pack.c, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-12-17T23:06:40Z</updated>
<entry>
<title>Merge branch 'tb/partial-clone-filters-fix'</title>
<updated>2020-12-17T23:06:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-17T23:06:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=21127fa9829da1f7b805e44517970194490567d0'/>
<id>urn:sha1:21127fa9829da1f7b805e44517970194490567d0</id>
<content type='text'>
Fix potential server side resource deallocation issues when
responding to a partial clone request.

* tb/partial-clone-filters-fix:
  upload-pack.c: don't free allowed_filters util pointers
  builtin/clone.c: don't ignore transport_fetch_refs() errors
</content>
</entry>
<entry>
<title>Merge branch 'jk/multi-line-indent-style-fix'</title>
<updated>2020-12-14T18:21:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-14T18:21:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3c9f0df16a20071aa6810152dd7f4003f3d96c4b'/>
<id>urn:sha1:3c9f0df16a20071aa6810152dd7f4003f3d96c4b</id>
<content type='text'>
Style fix.

* jk/multi-line-indent-style-fix:
  style: indent multiline "if" conditions to align
</content>
</entry>
<entry>
<title>Merge branch 'jk/check-config-parsing-error-in-upload-pack'</title>
<updated>2020-12-14T18:21:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-14T18:21:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a5e74b4baaf17ea069fa451c405ef219eb61ee7a'/>
<id>urn:sha1:a5e74b4baaf17ea069fa451c405ef219eb61ee7a</id>
<content type='text'>
Tighten error checking in the codepath that responds to "git fetch".

* jk/check-config-parsing-error-in-upload-pack:
  upload-pack: propagate return value from object filter config callback
</content>
</entry>
<entry>
<title>Merge branch 'js/trace2-session-id'</title>
<updated>2020-12-08T23:11:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-08T23:11:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=01b8886a62243c93cc57758bbaae08e11b09b9e1'/>
<id>urn:sha1:01b8886a62243c93cc57758bbaae08e11b09b9e1</id>
<content type='text'>
The transport layer was taught to optionally exchange the session
ID assigned by the trace2 subsystem during fetch/push transactions.

* js/trace2-session-id:
  receive-pack: log received client session ID
  send-pack: advertise session ID in capabilities
  upload-pack, serve: log received client session ID
  fetch-pack: advertise session ID in capabilities
  transport: log received server session ID
  serve: advertise session ID in v2 capabilities
  receive-pack: advertise session ID in v0 capabilities
  upload-pack: advertise session ID in v0 capabilities
  trace2: add a public function for getting the SID
  docs: new transfer.advertiseSID option
  docs: new capability to advertise session IDs
</content>
</entry>
<entry>
<title>upload-pack.c: don't free allowed_filters util pointers</title>
<updated>2020-12-03T20:42:33Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2020-12-03T18:55:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d133f500a5390a089988141cdec8154a732764d'/>
<id>urn:sha1:8d133f500a5390a089988141cdec8154a732764d</id>
<content type='text'>
To keep track of which object filters are allowed or not, 'git
upload-pack' stores the name of each filter in a string_list, and sets
it -&gt;util pointer to be either 0 or 1, indicating whether it is banned
or allowed.

Later on, we attempt to clear that list, but we incorrectly ask for the
util pointers to be free()'d, too. This behavior (introduced back in
6dd3456a8c (upload-pack.c: allow banning certain object filter(s),
2020-08-03)) leads to an invalid free, and causes us to crash.

In order to trigger this, one needs to fetch from a server that (a) has
at least one object filter allowed, and (b) issue a fetch that contains
a subset of the allowed filters (i.e., we cannot ask for a banned
filter, since this causes us to die() before we hit the bogus
string_list_clear()).

In that case, whatever banned filters exist will cause a noop free()
(since those -&gt;util pointers are set to 0), but the first allowed filter
we try to free will crash us.

We never noticed this in the tests because we didn't have an example of
setting 'uploadPackFilter' configuration variables and then following up
with a valid fetch. The first new 'git clone' prevents further
regression here. For good measure on top, add a test which checks the
same behavior at a tree depth greater than 0.

Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>style: indent multiline "if" conditions to align</title>
<updated>2020-12-03T18:32:32Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-12-03T08:00:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=08e9df2395b1116ffe932eaedbc3c89676902362'/>
<id>urn:sha1:08e9df2395b1116ffe932eaedbc3c89676902362</id>
<content type='text'>
Commit 6dc905d974 (config: split repo scope to local and worktree,
2020-02-10) made some "if" statements multiline, but didn't indent the
second lines in our usual way.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>upload-pack: propagate return value from object filter config callback</title>
<updated>2020-12-03T18:25:13Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-12-03T08:09:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d43a21bdbbaf0bc286df8d8e2e29a3e9caa448e8'/>
<id>urn:sha1:d43a21bdbbaf0bc286df8d8e2e29a3e9caa448e8</id>
<content type='text'>
If we encounter an error in parse_filter_object_config(), we'll complain
to stderr but won't actually propagate the return value up the stack.
This is unlike most of our config callbacks, which return the error to
git_config() so it can die (this includes the call just below us to
parse_hide_refs_config(), which can also produce errors).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/stop-pack-objects-when-fetch-is-killed'</title>
<updated>2020-12-03T08:18:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-12-03T08:18:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f3a112a75effe4ea7dca4d47edeced43fb77691a'/>
<id>urn:sha1:f3a112a75effe4ea7dca4d47edeced43fb77691a</id>
<content type='text'>
"git fetch" that is killed may leave a pack-objects process behind,
still computing to find a good compression, wasting cycles.  This
has been corrected.

* jk/stop-pack-objects-when-fetch-is-killed:
  upload-pack: kill pack-objects helper on signal or exit
</content>
</entry>
<entry>
<title>upload-pack: kill pack-objects helper on signal or exit</title>
<updated>2020-12-01T20:05:58Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2020-12-01T12:15:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=309a4028e72b5f6050d5cf17b5056cc3ea14c16b'/>
<id>urn:sha1:309a4028e72b5f6050d5cf17b5056cc3ea14c16b</id>
<content type='text'>
We spawn an external pack-objects process to actually send objects to
the remote side. If we are killed by a signal during this process, then
pack-objects may continue to run. As soon as it starts producing output
for the pack, it will see a failure writing to upload-pack and exit
itself. But before then, it may do significant work traversing the
object graph, compressing deltas, etc, which will all be pointless. So
let's make sure to kill as soon as we know that the caller will not read
the result.

There's no test here, since it's inherently racy, but here's an easy
reproduction is on a large-ish repo like linux.git:

  - make sure you don't have pack bitmaps (since they make the enumerating
    phase go quickly). For linux.git it takes ~30s or so to walk the
    whole graph on my machine.

  - run "git clone --no-local -q . dst"; the "-q" is important because
    if pack-objects is writing progress to upload-pack (to get
    multiplexed over the sideband to the client), then it will notice
    pretty quickly the failure to write to stderr

  - kill the client-side clone process in another terminal (don't use
    ^C, as that will send SIGINT to all of the processes)

  - run "ps au | grep git" or similar to observe upload-pack dying
    within 5 seconds (it will send a keepalive that will notice the
    client has gone away)

  - but you'll still see pack-objects consuming 100% CPU (and 1GB+ of
    RAM) during the traversal and delta compression phases. It will exit
    as soon as it starts to write the pack (when it will notice that
    upload-pack went away).

With this patch, pack-objects exits as soon as upload-pack does.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>upload-pack, serve: log received client session ID</title>
<updated>2020-11-12T02:26:53Z</updated>
<author>
<name>Josh Steadmon</name>
<email>steadmon@google.com</email>
</author>
<published>2020-11-11T23:29:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=829594677c3cd02f7d88b3cd3c72ad06f68faa14'/>
<id>urn:sha1:829594677c3cd02f7d88b3cd3c72ad06f68faa14</id>
<content type='text'>
When upload-pack (protocol v0/v1) or a protocol v2 server receives a
session-id capability from a client, log the received session ID via a
trace2 data event.

Signed-off-by: Josh Steadmon &lt;steadmon@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
