git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Fabian Stelzer <fs@gigacodes.de>,
	Git List Mailing <git@vger.kernel.org>
Subject: Re: git ssh signing changed broke tag merge message contents
Date: Mon, 10 Jan 2022 09:31:41 -0800	[thread overview]
Message-ID: <xmqqsftv1oqq.fsf@gitster.g> (raw)
In-Reply-To: <YdxqshqXB/+ApOn2@nand.local> (Taylor Blau's message of "Mon, 10 Jan 2022 12:19:46 -0500")

Taylor Blau <me@ttaylorr.com> writes:

> I'll write up the details and post the patch shortly, but an easy fix
> is:

Ah, I am glad that you beat me ;-)

> --- 8< ---
>
> diff --git a/fmt-merge-msg.c b/fmt-merge-msg.c
> index e5c0aff2bf..baca57d5b6 100644
> --- a/fmt-merge-msg.c
> +++ b/fmt-merge-msg.c
> @@ -541,7 +541,6 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
>  			else
>  				strbuf_addstr(&sig, sigc.output);
>  		}
> -		signature_check_clear(&sigc);
>
>  		if (!tag_number++) {
>  			fmt_tag_signature(&tagbuf, &sig, buf, len);
> @@ -565,6 +564,7 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
>  		}
>  		strbuf_release(&payload);
>  		strbuf_release(&sig);
> +		signature_check_clear(&sigc);
>  	next:
>  		free(origbuf);
>  	}
>
> --- >8 ---
>
> Our coverage in t6200 (which should have ordinarily caught such a bug)
> is lacking and does not search for the tag message in fmt-merge-msg's
> output.

True.

Thanks, both.

  parent reply	other threads:[~2022-01-10 17:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 16:42 git ssh signing changed broke tag merge message contents Linus Torvalds
2022-01-10 17:19 ` Taylor Blau
2022-01-10 17:22   ` Linus Torvalds
2022-01-10 17:31   ` Junio C Hamano [this message]
2022-01-10 21:19   ` [PATCH] fmt-merge-msg: prevent use-after-free with signed tags Taylor Blau
2022-01-10 21:38     ` Junio C Hamano
2022-01-11  8:41     ` Fabian Stelzer
2022-01-11 15:42       ` Taylor Blau

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=xmqqsftv1oqq.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=fs@gigacodes.de \
    --cc=git@vger.kernel.org \
    --cc=me@ttaylorr.com \
    --cc=torvalds@linux-foundation.org \
    /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).