From: "René Scharfe" <l.s.r@web.de>
To: Taylor Blau <me@ttaylorr.com>
Cc: Git Mailing List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>,
Jonathan Tan <jonathantanmy@google.com>
Subject: Re: [PATCH] fetch-pack: disregard invalid pack lockfiles
Date: Mon, 30 Nov 2020 21:15:47 +0100 [thread overview]
Message-ID: <67cf2f10-43a4-1200-0c60-dada466eadb9@web.de> (raw)
In-Reply-To: <X8VNszeQKJPfZ+Ht@nand.local>
Am 30.11.20 um 20:53 schrieb Taylor Blau:
> On Mon, Nov 30, 2020 at 08:27:15PM +0100, René Scharfe wrote:
>> index_pack_lockfile() can return NULL if it doesn't like the contents it
>> reads from the file descriptor passed to it. unlink(2) is declared to
>> not accept NULL pointers (at least with glibc). Undefined Behavior
>> Sanitizer together with Address Sanitizer detects a case where a NULL
>> lockfile name is passed to unlink(2) by transport_unlock_pack() in t1060
>> (make SANITIZE=address,undefined; cd t; ./t1060-object-corruption.sh).
>
> Which test in t1060? I tried to reproduce this myself, but couldn't seem
> to coax out a failure. (Initially I thought that my ccache wasn't
> letting me recompile with the SANITIZE options, but running 'ccache
> clear' and then trying again left the test still passing).
15 - fetch into corrupted repo with index-pack
$ cat trash\ directory.t1060-object-corruption/bit-error-cp/stderr
error: inflate: data stream error (invalid distance too far back)
error: unable to unpack d95f3ad14dee633a758d2e331151e950dd13e4ed header
fatal: cannot read existing object info d95f3ad14dee633a758d2e331151e950dd13e4ed
fatal: index-pack failed
wrapper.c:568:52: runtime error: null pointer passed as argument 1, which is declared to never be null
/usr/include/unistd.h:825:48: note: nonnull attribute specified here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior wrapper.c:568:52 in
Aborted
Compiled with:
Debian clang version 11.0.0-5+b1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
René
next prev parent reply other threads:[~2020-11-30 20:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-30 19:27 [PATCH] fetch-pack: disregard invalid pack lockfiles René Scharfe
2020-11-30 19:53 ` Taylor Blau
2020-11-30 20:15 ` René Scharfe [this message]
2020-11-30 20:22 ` Taylor Blau
2020-12-01 4:53 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=67cf2f10-43a4-1200-0c60-dada466eadb9@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jonathantanmy@google.com \
--cc=me@ttaylorr.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).