diff options
author | Matheus Tavares <matheus.bernardino@usp.br> | 2020-01-16 02:39:51 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-01-17 21:52:14 (GMT) |
commit | d5b0bac52841857b5ba197ca931ecf729fdbc63e (patch) | |
tree | c62f4c933d0c0f79cde157c53c081308f624f2d9 /object-store.h | |
parent | faf123c730df1a545e2dc7ca82fd437e93fc519c (diff) | |
download | git-d5b0bac52841857b5ba197ca931ecf729fdbc63e.zip git-d5b0bac52841857b5ba197ca931ecf729fdbc63e.tar.gz git-d5b0bac52841857b5ba197ca931ecf729fdbc63e.tar.bz2 |
grep: fix racy calls in grep_objects()
deref_tag() calls is_promisor_object() and parse_object(), both of which
perform lazy initializations and other thread-unsafe operations. If it
was only called by grep_objects() this wouldn't be a problem as the
latter is only executed by the main thread. However, deref_tag() is also
present in read_object_file()'s call stack. So calling deref_tag() in
grep_objects() without acquiring the grep_read_mutex may incur in a race
condition with object reading operations (such as the ones internally
performed by fill_textconv(), called at fill_textconv_grep()). The same
problem happens with the call to gitmodules_config_oid() which also has
parse_object() in its call stack. Fix that protecting both calls with
the said grep_read_mutex.
Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-store.h')
0 files changed, 0 insertions, 0 deletions