git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [ANNOUNCE] Git v2.34.0-rc2

From
Jeff King <peff@peff.net>
Date
Nov 10, 2021, 06:00 UTC
Message-ID
<YYtgD8VT/0vuIHRX@coredump.intra.peff.net>
In-Reply-To
<YYtbdkLsCSFFE5io@coredump.intra.peff.net>
On Wed, Nov 10, 2021 at 12:41:11AM -0500, Jeff King wrote:
> So it may not be a bug we need to fix in Git. But shipping v2.34 with
> lots of test failures may cause some headaches. Maybe we need to tighten
> up the GPGSSH prereq checks to block broken versions?

This is what I came up with, but I'm not sure it there's a better way to find the broken version. I don't think there's a way to get a version number out of ssh-keygen (and anyway, checking the behavior of the command is a more robust test). My fears are:

  - this does cause several segfaults per test run on affected
    platforms, which will pollute the kernel log, etc.
  - we're not really testing the desired behavior, just looking for a
    known-problem. The segfault may get fixed but we'd still have other
    bugs.

So it would be nice to have a more exact test, but without understanding the openssh bug, I think this is the best we can do in the meantime.

-- >8 --
Subject: [PATCH] t/lib-gpg: avoid broken versions of ssh-keygen

The "-Y find-principals" option of ssh-keygen seems to be broken in Debian's openssh-client 1:8.7p1-1, whereas it works fine in 1:8.4p1-5. This causes several failures for GPGSSH tests. We fulfill the prerequisite because generating the keys works fine, but actually verifying a signature causes results ranging from bogus results to ssh-keygen segfaulting.

We can find the broken version during the prereq check by feeding it empty input. This should result in it complaining to stderr, but in the broken version it triggers the segfault, causing the GPGSSH tests to be skipped.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/lib-gpg.sh | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
index 1d8e5b5b7e..a3f285f515 100644
--- a/t/lib-gpg.sh
+++ b/t/lib-gpg.sh
@@ -104,6 +104,12 @@ test_lazy_prereq GPGSSH '
 	test $? != 127 || exit 1
 	echo $ssh_version | grep -q "find-principals:missing signature file"
 	test $? = 0 || exit 1;
+
+	# some broken versions of ssh-keygen segfault on find-principals;
+	# avoid testing with them.
+	ssh-keygen -Y find-principals -f /dev/null -s /dev/null
+	test $? = 139 && exit 1
+
 	mkdir -p "${GNUPGHOME}" &&
 	chmod 0700 "${GNUPGHOME}" &&
 	(setfacl -k "${GNUPGHOME}" 2>/dev/null || true) &&
-- 
2.34.0.rc1.634.g85d556ea55
Previous: Jeff KingNext: Carlo Arenas
Message 3 of 23 in “[ANNOUNCE] Git v2.34.0-rc2”
  1. Junio C HamanoNov 10, 2021
  2. Jeff KingNov 10, 2021
  3. Jeff KingNov 10, 2021
  4. Carlo ArenasNov 10, 2021
  5. Jeff KingNov 10, 2021
  6. Carlo ArenasNov 10, 2021
  7. Jeff KingNov 10, 2021
  8. RelNotes: mention known crasher when ssh signing with OpenSSH 8.7Carlo Marcelo Arenas Belón, Nov 10, 2021
  9. Junio C HamanoNov 10, 2021
  10. Junio C HamanoNov 10, 2021
  11. Jeff KingNov 11, 2021
  12. Junio C HamanoNov 10, 2021
  13. Johannes AltmanningerNov 10, 2021
  14. Jeff KingNov 10, 2021
  15. Junio C HamanoNov 10, 2021
  16. Jeff KingNov 11, 2021
  17. Junio C HamanoNov 11, 2021
  18. Jeff KingNov 11, 2021
  19. Junio C HamanoNov 11, 2021
  20. Patrick SteinhardtNov 15, 2021
  21. Jeff KingNov 15, 2021
  22. Jeff KingNov 15, 2021
  23. Junio C HamanoNov 13, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.