<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/libgit2.git/src/mwindow.c, branch ethomson/codespaces</title>
<subtitle>github.com: libgit2/libgit2.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/'/>
<entry>
<title>Remove sus unsigned long constant</title>
<updated>2021-07-08T02:29:28+00:00</updated>
<author>
<name>Calvin Buckley</name>
<email>calvin@cmpct.info</email>
</author>
<published>2021-07-08T02:29:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=fcfaea4d405ff92a2512dc8ada4df629a49291ec'/>
<id>fcfaea4d405ff92a2512dc8ada4df629a49291ec</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Convert long long constant specifiers to stdint macros</title>
<updated>2021-07-07T22:12:02+00:00</updated>
<author>
<name>Calvin Buckley</name>
<email>calvin@cmpct.info</email>
</author>
<published>2021-07-07T22:12:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=52505ab5a2f0235d73553b6e8ecaa45943d1efc6'/>
<id>52505ab5a2f0235d73553b6e8ecaa45943d1efc6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>mwindow: Fix a bug in the LRU window finding code</title>
<updated>2021-01-20T12:40:40+00:00</updated>
<author>
<name>lhchavez</name>
<email>lhchavez@lhchavez.com</email>
</author>
<published>2021-01-20T12:40:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=2f382ab74b7b8568b47e118f1802763a911b84e3'/>
<id>2f382ab74b7b8568b47e118f1802763a911b84e3</id>
<content type='text'>
This change now updates the `lru_window` variable to match the current
file's MRU window. This makes it such that it doesn't always choose the
file that happened to come last in the list of window files, and instead
should now correctly choose the file with the least-recently-used one.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change now updates the `lru_window` variable to match the current
file's MRU window. This makes it such that it doesn't always choose the
file that happened to come last in the list of window files, and instead
should now correctly choose the file with the least-recently-used one.
</pre>
</div>
</content>
</entry>
<entry>
<title>threads: rename git_atomic to git_atomic32</title>
<updated>2020-12-06T01:08:22+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-12-05T15:26:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=37763d38fbf5db932be8d6a0070255839e7719ca'/>
<id>37763d38fbf5db932be8d6a0070255839e7719ca</id>
<content type='text'>
Clarify the `git_atomic` type and functions now that we have a 64 bit
version as well (`git_atomic64`).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clarify the `git_atomic` type and functions now that we have a 64 bit
version as well (`git_atomic64`).
</pre>
</div>
</content>
</entry>
<entry>
<title>Make the pack and mwindow implementations data-race-free</title>
<updated>2020-11-29T03:40:56+00:00</updated>
<author>
<name>lhchavez</name>
<email>lhchavez@lhchavez.com</email>
</author>
<published>2020-08-02T01:24:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=322c15ee858622f2e3def514d3e7e1b47023950e'/>
<id>322c15ee858622f2e3def514d3e7e1b47023950e</id>
<content type='text'>
This change fixes a packfile heap corruption that can happen when
interacting with multiple packfiles concurrently across multiple
threads. This is exacerbated by setting a lower mwindow open file limit.

This change:

* Renames most of the internal methods in pack.c to clearly indicate
  that they expect to be called with a certain lock held, making
  reasoning about the state of locks a bit easier.
* Splits the `git_pack_file` lock in two: the one in `git_pack_file`
  only protects the `index_map`. The protection to `git_mwindow_file` is
  now in that struct.
* Explicitly checks for freshness of the `git_pack_file` in
  `git_packfile_unpack_header`: this allows the mwindow implementation
  to close files whenever there is enough cache pressure, and
  `git_packfile_unpack_header` will reopen the packfile if needed.
* After a call to `p_munmap()`, the `data` and `len` fields are poisoned
  with `NULL` to make use-after-frees more evident and crash rather than
  being open to the possibility of heap corruption.
* Adds a test case to prevent this from regressing in the future.

Fixes: #5591
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change fixes a packfile heap corruption that can happen when
interacting with multiple packfiles concurrently across multiple
threads. This is exacerbated by setting a lower mwindow open file limit.

This change:

* Renames most of the internal methods in pack.c to clearly indicate
  that they expect to be called with a certain lock held, making
  reasoning about the state of locks a bit easier.
* Splits the `git_pack_file` lock in two: the one in `git_pack_file`
  only protects the `index_map`. The protection to `git_mwindow_file` is
  now in that struct.
* Explicitly checks for freshness of the `git_pack_file` in
  `git_packfile_unpack_header`: this allows the mwindow implementation
  to close files whenever there is enough cache pressure, and
  `git_packfile_unpack_header` will reopen the packfile if needed.
* After a call to `p_munmap()`, the `data` and `len` fields are poisoned
  with `NULL` to make use-after-frees more evident and crash rather than
  being open to the possibility of heap corruption.
* Adds a test case to prevent this from regressing in the future.

Fixes: #5591
</pre>
</div>
</content>
</entry>
<entry>
<title>mwindow: use GIT_ASSERT</title>
<updated>2020-11-27T11:09:20+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-04-05T16:18:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=a3e8b7cd3e49bdcffc9d9d5bda1d134a448932e2'/>
<id>a3e8b7cd3e49bdcffc9d9d5bda1d134a448932e2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>runtime: move init/shutdown into the "runtime"</title>
<updated>2020-10-11T19:13:04+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-05-15T10:47:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=e316b0d3d64eb8f65f4109c1565d929b29e1d33a'/>
<id>e316b0d3d64eb8f65f4109c1565d929b29e1d33a</id>
<content type='text'>
Provide a mechanism for system components to register for initialization
and shutdown of the libgit2 runtime.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide a mechanism for system components to register for initialization
and shutdown of the libgit2 runtime.
</pre>
</div>
</content>
</entry>
<entry>
<title>mwindow: localize mutex</title>
<updated>2020-10-11T13:43:37+00:00</updated>
<author>
<name>Edward Thomson</name>
<email>ethomson@edwardthomson.com</email>
</author>
<published>2020-05-13T09:48:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=8aa69f887afaced1389d1ae965d5f313b10da66b'/>
<id>8aa69f887afaced1389d1ae965d5f313b10da66b</id>
<content type='text'>
Move the mwindow mutex into the mwindow code itself, initializing it in
the mwindow global initialization function instead of in the global
initializer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move the mwindow mutex into the mwindow code itself, initializing it in
the mwindow global initialization function instead of in the global
initializer.
</pre>
</div>
</content>
</entry>
<entry>
<title>Preserve behaviour of `git_mwindow_scan_recently_used` with `*out_window` set</title>
<updated>2020-08-05T21:04:15+00:00</updated>
<author>
<name>Andrew Hickman</name>
<email>andrew.hickman1@sky.com</email>
</author>
<published>2020-08-05T21:04:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=04d59466238e69c57d2a82d0693a77ecb05e1194'/>
<id>04d59466238e69c57d2a82d0693a77ecb05e1194</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix `git_mwindow_scan_recently_used` spuriously returning true</title>
<updated>2020-08-05T19:57:34+00:00</updated>
<author>
<name>Andrew Hickman</name>
<email>andrew.hickman1@sky.com</email>
</author>
<published>2020-08-05T19:22:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/libgit2.git/commit/?id=8ea9187aecf52854688c3509feb7cdff8623823e'/>
<id>8ea9187aecf52854688c3509feb7cdff8623823e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
