<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git, branch v2.2.3</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=v2.2.3</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=v2.2.3'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2015-09-04T17:26:23Z</updated>
<entry>
<title>Git 2.2.3</title>
<updated>2015-09-04T17:26:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-04T17:25:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=441c4a40173fe1ee8a5c0094e587dfc47e2a6460'/>
<id>urn:sha1:441c4a40173fe1ee8a5c0094e587dfc47e2a6460</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/long-paths' into maint-2.2</title>
<updated>2015-09-04T17:25:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-04T17:25:23Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f54cb059b18e704d8b51d0cd4736344422650d6f'/>
<id>urn:sha1:f54cb059b18e704d8b51d0cd4736344422650d6f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>show-branch: use a strbuf for reflog descriptions</title>
<updated>2015-09-04T16:48:26Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-08-19T18:12:48Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=78f23bdf68dae56d644892990484951583a64014'/>
<id>urn:sha1:78f23bdf68dae56d644892990484951583a64014</id>
<content type='text'>
When we show "branch@{0}", we format into a fixed-size
buffer using sprintf. This can overflow if you have long
branch names. We can fix it by using a temporary strbuf.

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>read_info_alternates: handle paths larger than PATH_MAX</title>
<updated>2015-09-04T16:36:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-08-19T18:12:45Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=5015f01c12a45a1042c1aa6b6f7f6b62bfa00ade'/>
<id>urn:sha1:5015f01c12a45a1042c1aa6b6f7f6b62bfa00ade</id>
<content type='text'>
This function assumes that the relative_base path passed
into it is no larger than PATH_MAX, and writes into a
fixed-size buffer. However, this path may not have actually
come from the filesystem; for example, add_submodule_odb
generates a path using a strbuf and passes it in. This is
hard to trigger in practice, though, because the long
submodule directory would have to exist on disk before we
would try to open its info/alternates file.

We can easily avoid the bug, though, by simply creating the
filename on the heap.

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>notes: use a strbuf in add_non_note</title>
<updated>2015-09-04T16:36:28Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-08-19T18:12:41Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=c29edfefb6f6a3fef80172c16bcc34c826d417b0'/>
<id>urn:sha1:c29edfefb6f6a3fef80172c16bcc34c826d417b0</id>
<content type='text'>
When we are loading a notes tree into our internal hash
table, we also collect any files that are clearly non-notes.
We format the name of the file into a PATH_MAX buffer, but
unlike true notes (which cannot be larger than a fanned-out
sha1 hash), these tree entries can be arbitrarily long,
overflowing our buffer.

We can fix this by switching to a strbuf. It doesn't even
cost us an extra allocation, as we can simply hand ownership
of the buffer over to the non-note struct.

This is of moderate security interest, as you might fetch
notes trees from an untrusted remote. However, we do not do
so by default, so you would have to manually fetch into the
notes namespace.

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>verify_absent: allow filenames longer than PATH_MAX</title>
<updated>2015-09-04T15:50:50Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-08-19T18:12:37Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f514ef9787f320287d7ba71f2965127b9d8b3832'/>
<id>urn:sha1:f514ef9787f320287d7ba71f2965127b9d8b3832</id>
<content type='text'>
When unpack-trees wants to know whether a path will
overwrite anything in the working tree, we use lstat() to
see if there is anything there. But if we are going to write
"foo/bar", we can't just lstat("foo/bar"); we need to look
for leading prefixes (e.g., "foo"). So we use the lstat cache
to find the length of the leading prefix, and copy the
filename up to that length into a temporary buffer (since
the original name is const, we cannot just stick a NUL in
it).

The copy we make goes into a PATH_MAX-sized buffer, which
will overflow if the prefix is longer than PATH_MAX. How
this happens is a little tricky, since in theory PATH_MAX is
the biggest path we will have read from the filesystem. But
this can happen if:

  - the compiled-in PATH_MAX does not accurately reflect
    what the filesystem is capable of

  - the leading prefix is not _quite_ what is on disk; it
    contains the next element from the name we are checking.
    So if we want to write "aaa/bbb/ccc/ddd" and "aaa/bbb"
    exists, the prefix of interest is "aaa/bbb/ccc". If
    "aaa/bbb" approaches PATH_MAX, then "ccc" can overflow
    it.

So this can be triggered, but it's hard to do. In
particular, you cannot just "git clone" a bogus repo. The
verify_absent checks happen before unpack-trees writes
anything to the filesystem, so there are never any leading
prefixes during the initial checkout, and the bug doesn't
trigger. And by definition, these files are larger than
PATH_MAX, so writing them will fail, and clone will
complain (though it may write a partial path, which will
cause a subsequent "git checkout" to hit the bug).

We can fix it by creating the temporary path on the heap.
The extra malloc overhead is not important, as we are
already making at least one stat() call (and probably more
for the prefix discovery).

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>Git 2.2.2</title>
<updated>2015-01-12T22:06:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-12T22:06:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=fdf96a20acf96a6ac538df8113b2aafd6ed71d50'/>
<id>urn:sha1:fdf96a20acf96a6ac538df8113b2aafd6ed71d50</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/read-packed-refs-without-path-max' into maint</title>
<updated>2015-01-12T22:02:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-12T22:02:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=9f16184af5a1ccfbc05d7ec763d4b4e0469a326e'/>
<id>urn:sha1:9f16184af5a1ccfbc05d7ec763d4b4e0469a326e</id>
<content type='text'>
* jk/read-packed-refs-without-path-max:
  read_packed_refs: use skip_prefix instead of static array
  read_packed_refs: pass strbuf to parse_ref_line
  read_packed_refs: use a strbuf for reading lines
</content>
</entry>
<entry>
<title>Merge branch 'mg/add-ignore-errors' into maint</title>
<updated>2015-01-12T22:02:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-12T22:02:19Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d0879b33a6c34285a870e351e8eaee5cd695e92d'/>
<id>urn:sha1:d0879b33a6c34285a870e351e8eaee5cd695e92d</id>
<content type='text'>
* mg/add-ignore-errors:
  add: ignore only ignored files
</content>
</entry>
<entry>
<title>Merge branch 'mh/find-uniq-abbrev' into maint</title>
<updated>2015-01-12T22:02:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-01-12T22:02:05Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=efc028b1f2c6da6558094326083f7643453bfccd'/>
<id>urn:sha1:efc028b1f2c6da6558094326083f7643453bfccd</id>
<content type='text'>
* mh/find-uniq-abbrev:
  sha1_name: avoid unnecessary sha1 lookup in find_unique_abbrev
</content>
</entry>
</feed>
