1. 13 Dec, 2020 5 commits
  2. 11 Dec, 2020 3 commits
  3. 09 Dec, 2020 6 commits
  4. 08 Dec, 2020 3 commits
  5. 06 Dec, 2020 5 commits
  6. 05 Dec, 2020 5 commits
  7. 29 Nov, 2020 3 commits
    • Merge pull request #5593 from lhchavez/fix-mwindow-thread-unsafety · 87e4597c
      Make the pack and mwindow implementations data-race-free
      Edward Thomson committed
    • Merge pull request #5595 from lhchavez/odb-race-free · 5699ef81
      Make the odb race-free
      Edward Thomson committed
    • Make the pack and mwindow implementations data-race-free · 322c15ee
      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
      lhchavez committed
  8. 28 Nov, 2020 1 commit
  9. 27 Nov, 2020 9 commits
    • Merge pull request #5704 from lhchavez/ssh-raw-certificate · ef6de8d5
      Also add the raw hostkey to `git_cert_hostkey`
      Edward Thomson committed
    • Merge pull request #5715 from lhchavez/fix-non-debug-build · 079a40ca
      Fix the `ENABLE_WERROR=ON` build in Groovy Gorilla (gcc 10.2)
      Edward Thomson committed
    • Fix the non-debug build in Groovy Gorilla (gcc 10.2) · 5db304f0
      The release build has been failing with the following error:
      
      ```shell
      FAILED: src/CMakeFiles/git2internal.dir/hash.c.o
      /usr/bin/cc -DHAVE_QSORT_R_GNU -DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\" -DSHA1DC_NO_STANDARD_INCLUDES=1 -D_FILE_OFFSET_BITS=64 -Isrc -I../src -I../include -I../deps/pcre -I../deps/http-parser -D_GNU_SOURCE -fsanitize=thread -fno-optimize-sibling-calls -fno-omit-frame-pointer -Werror -Wall -Wextra -fvisibility=
      hidden -fPIC -Wno-documentation-deprecated-sync -Wno-missing-field-initializers -Wstrict-aliasing -Wstrict-prototypes -Wdeclaration-after-statement -Wshift-count-overflow -Wunused-const-variable -Wunused-function -Wint-conversion -Wformat -Wformat-security -Wmissing-declarations -g -D_DEBUG -O0   -std=gnu90 -MD -MT src/CMakeFiles/git2internal.dir/hash.c.o -MF s
      rc/CMakeFiles/git2internal.dir/hash.c.o.d -o src/CMakeFiles/git2internal.dir/hash.c.o   -c ../src/hash.c
      ../src/hash.c: In function ‘git_hash_init’:
      ../src/hash.c:47:1: error: control reaches end of non-void function [-Werror=return-type]
         47 | }
            | ^
      ../src/hash.c: In function ‘git_hash_update’:
      ../src/hash.c:58:1: error: control reaches end of non-void function [-Werror=return-type]
         58 | }
            | ^
      ../src/hash.c: In function ‘git_hash_final’:
      ../src/hash.c:68:1: error: control reaches end of non-void function [-Werror=return-type]
         68 | }
            | ^
      ../src/hash.c: At top level:
      cc1: note: unrecognized command-line option ‘-Wno-documentation-deprecated-sync’ may have been intended to silence earlier diagnostics
      cc1: all warnings being treated as errors
      [11/533] Building C object src/CMakeFiles/git2internal.dir/odb_pack.c.o
      ninja: build stopped: subcommand failed.
      ```
      
      The compiler _should_ be able to figure out that there is no way to reach the
      end of the non-void function since `GIT_ASSERT(0)` expands to either `assert()`
      or an unconditional `return -1;` (after doing constant folding and stuff,
      depending on the debug level). But it's not doing so at the moment, so let's
      help it.
      lhchavez committed
    • Also add the raw hostkey to `git_cert_hostkey` · 29fe5f61
      `git_cert_x509` has the raw encoded certificate. Let's do the same for
      the SSH certificate for symmetry.
      lhchavez committed
    • midx: Support multi-pack-index files in odb_pack.c · f847fa7b
      This change adds support for reading multi-pack-index files from the
      packfile odb backend. This also makes git_pack_file objects open their
      backing failes lazily in more scenarios, since the multi-pack-index can
      avoid having to open them in some cases (yay!).
      
      This change also refreshes the documentation found in src/odb_pack.c to
      match the updated code.
      
      Part of: #5399
      lhchavez committed
    • Merge pull request #5327 from libgit2/ethomson/assert · fa618a59
      Introduce GIT_ASSERT macros
      Edward Thomson committed
    • win32: use GIT_ASSERT · c6ebdb29
      Edward Thomson committed
    • transports: use GIT_ASSERT · 4f5f1127
      Edward Thomson committed