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

Re: [PATCH 0/2] Revert defense-in-depth patches breaking Git LFS

From
Joey Hess <id@joeyh.name>
Date
May 22, 2024, 09:49 UTC
Message-ID
<Zk2_mJpE7tJgqxSp@kitenet.net>
In-Reply-To
<ZkO-b6Nswrn9H7Ed@tapette.crustytoothpaste.net>
brian m. carlson wrote:
> If these protections hadn't broken things, I'd agree that we should keep
> them.  However, they have broken things and they've introduced a
> serious regression breaking a major project, and we should revert them.

More than one major project; they also broke git-annex in the case where a git-annex repository, which contains symlinks into .git/annex/objects/, is pushed to a bare repository with receive.fsckObjects set. (Gitlab is currently affected[1].)

BTW, do I understand correctly that the defence in depth patch set was developed under embargo and has never been publically reviewed?

Looking at commit a33fea0886cfa016d313d2bd66bdd08615bffbc9, I noticed that its PATH_MAX check is also dodgy due to that having values ranging from 260 (Windows) to 1024 (Freebsd) to 4096 (Linux), which means git repositories containing legitimate, working symlinks can now fail to be pushed depending on what OS happens to host a reciving bare repository.

+                               if (is_ntfs_dotgit(p))

This means that symlinks to eg "git~1" are also warned about, which seems strange behavior on eg Linux.

+                               backslash = memchr(p, '\\', slash - p);

This and other backslash handling code for some reason is also run on linux, so a symlink to eg "ummmm\\git~1" is also warned about.

+               if (!buf || size > PATH_MAX) {

I suspect, but have not confirmed, that this is allows a symlink target 1 byte longer than the OS supports, because PATH_MAX includes a trailing NUL.

All in all, this seems to need more review and a more careful consideration of breakage now that the security holes are not under embargo.

-- 
see shy jo

[1] https://forum.gitlab.com/t/recent-git-v2-45-1-breaks-git-annex-compatibility-because-of-apparent-fsck-symlinkpointstogitdir-error-on-gitlab/104909
Previous: brian m. carlsonNext: Johannes Schindelin
Message 6 of 14 in “Revert defense-in-depth patches breaking Git LFS”
  1. 0/2 Revert defense-in-depth patches breaking Git LFSbrian m. carlson, May 14, 2024
  2. 2/2 Revert "core.hooksPath: add some protection while cloning"brian m. carlson, May 14, 2024
  3. 1/2 Revert "clone: prevent hooks from running during a clone"brian m. carlson, May 14, 2024
  4. Johannes SchindelinMay 14, 2024
  5. brian m. carlsonMay 14, 2024
  6. Joey HessMay 22, 2024
  7. Johannes SchindelinMay 27, 2024
  8. Joey HessMay 28, 2024
  9. Jeff KingMay 29, 2024
  10. Johannes SchindelinMay 29, 2024
  11. Junio C HamanoMay 29, 2024
  12. Jeff KingMay 30, 2024
  13. Joey HessMay 24, 2024
  14. Junio C HamanoMay 28, 2024

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.