git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <johannes.schindelin@gmx.de>, git@vger.kernel.org
Subject: Re: [PATCH 4/6] fsck: check tag objects' headers
Date: Wed, 3 Sep 2014 18:29:37 -0400	[thread overview]
Message-ID: <20140903222937.GA30560@peff.net> (raw)
In-Reply-To: <xmqqwq9o2s6l.fsf@gitster.dls.corp.google.com>

On Sun, Aug 31, 2014 at 03:46:42PM -0700, Junio C Hamano wrote:

> If "git fsck" were a tool to validate that the objects and refs are
> in line with how "git-core" plumbing and Porcelain toolset uses the
> underlying Git data model, it makes sense to insist a tag has a name
> that is suitable for a refname, and the tag is pointed by a ref in
> "refs/tags/" followed by its name.  The rules such a "git fsck" should
> implement would be stricter than what the underlying Git data model
> could represent and existing Git tools could handle (i.e. a commit
> with broken ident line may not be usable with "shortlog -e" and would
> be flagged as corrupt).

This is a bit of an aside, but why do we have the "tag" line in the tag
object in the first place?

It is part of the object contents, and therefore is part of the
signature (which the refname is not). That's somewhat redundant with the
tag message itself. E.g., the git v2.0.4 tag says:

  object 32f56600bb6ac6fc57183e79d2c1515dfa56672f
  type commit
  tag v2.0.4
  tagger Junio C Hamano <gitster@pobox.com> 1406755201 -0700

  Git 2.0.4
  -----BEGIN PGP SIGNATURE-----
  ...

Imagine an evil person pushed the signed v2.0.4 tag to refs/tags/v2.1.0
(perhaps because there is a bug in v2.0.4, and they want you to run the
wrong version so they can exploit it). You can check with "git show"
that the "tag" field is actually v2.0.4, but then you could similarly
check that the message says "Git 2.0.4".

The main advantage of the "tag" field is that it is machine-readable,
and that your verification process can check that "git verify-tag
v2.1.0" actually returns a tag that says "tag v2.1.0". But I do not
think we do that verification at all. I wonder if that is something we
should add support for.

You gave examples later in your email of tags that would not necessarily
care about this tag field (and anyway, if "for-linus" is used over and
over, it is subject to these sorts of replays), so I do not think it is
something we would want unconditionally in verify-tag.

I think this may need to be filed under "possible policy flags for
verifying" that we discussed earlier (i.e., in the same boat as "does
the committer ident match the commit signature", as it is a
porcelain-ish policy, not an integral part of the plumbing).

So this is mostly food for thought at this point.

-Peff

  reply	other threads:[~2014-09-03 22:29 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 14:46 [PATCH 0/6] Improve tag checking in fsck and with transfer.fsckobjects Johannes Schindelin
2014-08-28 14:46 ` [PATCH 1/6] Refactor type_from_string() to avoid die()ing in case of errors Johannes Schindelin
2014-08-28 20:43   ` Junio C Hamano
2014-08-28 14:46 ` [PATCH 2/6] Accept object data in the fsck_object() function Johannes Schindelin
2014-08-28 20:47   ` Junio C Hamano
2014-08-29 23:10     ` Jeff King
2014-08-29 23:05   ` Jeff King
2014-08-28 14:46 ` [PATCH 3/6] Make sure fsck_commit_buffer() does not run out of the buffer Johannes Schindelin
2014-08-28 20:59   ` Junio C Hamano
2014-08-29 23:27   ` Jeff King
2014-08-28 14:46 ` [PATCH 4/6] fsck: check tag objects' headers Johannes Schindelin
2014-08-28 21:25   ` Junio C Hamano
2014-08-28 21:36     ` Junio C Hamano
2014-08-29 23:46       ` Jeff King
2014-08-31 22:46         ` Junio C Hamano
2014-09-03 22:29           ` Jeff King [this message]
2014-09-03 23:14             ` Junio C Hamano
2014-09-04  2:04               ` Jeff King
2014-08-29 23:43     ` Jeff King
2014-09-02 18:41       ` Junio C Hamano
2014-09-03 21:38         ` Jeff King
2014-08-28 14:46 ` [PATCH 5/6] Add regression tests for stricter tag fsck'ing Johannes Schindelin
2014-08-28 14:47 ` [PATCH 6/6] Make sure that index-pack --strict fails upon invalid tag objects Johannes Schindelin
2014-09-10 13:52 ` [PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects Johannes Schindelin
2014-09-10 13:58   ` Johannes Schindelin
2014-09-10 21:07   ` Junio C Hamano
2014-09-10 21:31     ` Junio C Hamano
2014-09-11 14:20       ` Johannes Schindelin
2014-09-11 14:26   ` [PATCH v3 " Johannes Schindelin
2014-09-11 14:26     ` [PATCH v3 1/6] Refactor type_from_string() to avoid die()ing in case of errors Johannes Schindelin
2014-09-11 14:26     ` [PATCH v3 2/6] Accept object data in the fsck_object() function Johannes Schindelin
2014-09-11 14:26     ` [PATCH v3 3/6] Make sure fsck_commit_buffer() does not run out of the buffer Johannes Schindelin
2014-09-11 14:26     ` [PATCH v3 4/6] fsck: check tag objects' headers Johannes Schindelin
2014-09-11 14:26     ` [PATCH v3 5/6] Add regression tests for stricter tag fsck'ing Johannes Schindelin
2014-09-11 14:26     ` [PATCH v3 6/6] Make sure that index-pack --strict checks tag objects Johannes Schindelin
2014-09-11 17:58       ` Junio C Hamano
2014-09-11 21:16         ` Junio C Hamano
2014-09-11 21:17           ` [PATCH 0/3] hash-object --literally Junio C Hamano
2014-09-11 21:17             ` [PATCH 1/3] hash-object: reduce file-scope statics Junio C Hamano
2014-09-11 21:17             ` [PATCH 2/3] hash-object: pass 'write_object' as a flag Junio C Hamano
2014-09-11 21:17             ` [PATCH 3/3] hash-object: add --literally option Junio C Hamano
2014-09-12  8:04           ` [PATCH v3 6/6] Make sure that index-pack --strict checks tag objects Johannes Schindelin
2014-09-12  8:07     ` [PATCH v4 0/6] Improve tag checking in fsck and with transfer.fsckobjects Johannes Schindelin
2014-09-12  8:07       ` [PATCH v4 1/6] Refactor type_from_string() to avoid die()ing in case of errors Johannes Schindelin
2014-09-12  8:07       ` [PATCH v4 2/6] Accept object data in the fsck_object() function Johannes Schindelin
2014-09-12  8:07       ` [PATCH v4 3/6] Make sure fsck_commit_buffer() does not run out of the buffer Johannes Schindelin
2014-09-12  8:08       ` [PATCH v4 4/6] fsck: check tag objects' headers Johannes Schindelin
2014-09-12  8:08       ` [PATCH v4 5/6] Add regression tests for stricter tag fsck'ing Johannes Schindelin
2014-09-12  8:08       ` [PATCH v4 6/6] Make sure that index-pack --strict checks tag objects Johannes Schindelin
2014-09-12 18:02       ` [PATCH v4 0/6] Improve tag checking in fsck and with transfer.fsckobjects Junio C Hamano
2014-09-13  9:08         ` Johannes Schindelin
     [not found] ` <cover.1410356761.git.johannes.schindelin@gmx.de>
2014-09-10 13:52   ` [PATCH v2 1/6] Refactor type_from_string() to avoid die()ing in case of errors Johannes Schindelin
2014-09-10 13:52   ` [PATCH v2 2/6] Accept object data in the fsck_object() function Johannes Schindelin
2014-09-10 13:52   ` [PATCH v2 3/6] Make sure fsck_commit_buffer() does not run out of the buffer Johannes Schindelin
2014-09-10 17:43     ` Junio C Hamano
2014-09-11 11:59       ` Johannes Schindelin
2014-09-11 16:49         ` Junio C Hamano
2014-09-10 20:45     ` Eric Sunshine
2014-09-10 13:53   ` [PATCH v2 4/6] fsck: check tag objects' headers Johannes Schindelin
2014-09-10 17:52     ` Junio C Hamano
2014-09-10 13:53   ` [PATCH v2 5/6] Add regression tests for stricter tag fsck'ing Johannes Schindelin
2014-09-10 17:56     ` Junio C Hamano
2014-09-11 14:15       ` Johannes Schindelin
2014-09-10 13:53   ` [PATCH v2 6/6] Make sure that index-pack --strict fails upon invalid tag objects Johannes Schindelin
2014-09-10 21:54     ` Junio C Hamano
2014-09-11 14:22       ` Johannes Schindelin
2014-09-11 16:50         ` Junio C Hamano
2014-09-11 17:04           ` Johannes Schindelin

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=20140903222937.GA30560@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    /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).