git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Jacek Wielemborek <d33tah@gmail.com>
Subject: [PATCH 0/3] out-of-bounds access from corrupted .idx files
Date: Thu, 25 Feb 2016 09:20:05 -0500	[thread overview]
Message-ID: <20160225142004.GA17678@sigill.intra.peff.net> (raw)

This series teaches Git to detect a few problems with corrupted .idx
files, and adds tests for some more cases.  There's conceptually some
overlap with t5300, but I don't think it was covering any of these cases
explicitly.

There are two real bugs that could cause segfaults or bus errors via
bogus reads (but never writes). On top of that, these are all problems
in .idx files, which are usually generated locally. So I don't think
there's anything particularly security interesting here. You'd need a
situation where you convince somebody to read your .idx files (so maybe
a multi-user server), and then I don't see how you'd turn it into remote
code execution.

I think with these patches, fuzzing .idx files should never result in
any memory problems (though of course git will die()).  Famous last
words, of course. I stopped short of poking at other file formats, which
might have similar issues. Obvious candidates are .bitmap files, and the
on-disk $GIT_DIR/index.

  [1/3]: t5313: test bounds-checks of corrupted/malicious pack/idx files
  [2/3]: nth_packed_object_offset: bounds-check extended offset
  [3/3]: use_pack: handle signed off_t overflow

-Peff

             reply	other threads:[~2016-02-25 14:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-25 14:20 Jeff King [this message]
2016-02-25 14:21 ` [PATCH 1/3] t5313: test bounds-checks of corrupted/malicious pack/idx files Jeff King
2016-02-25 19:12   ` Johannes Sixt
2016-02-25 20:31     ` Junio C Hamano
2016-02-25 22:07       ` Jeff King
2016-02-25 14:22 ` [PATCH 2/3] nth_packed_object_offset: bounds-check extended offset Jeff King
2016-02-25 14:23 ` [PATCH 3/3] use_pack: handle signed off_t overflow Jeff King
2016-02-27  7:49 ` [PATCH 4/3] sha1_file.c: mark strings for translation Nguyễn Thái Ngọc Duy
2016-02-27 17:41   ` Junio C Hamano
2016-02-27 18:25     ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160225142004.GA17678@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=d33tah@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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 NNTP newsgroup(s).