git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Derrick Stolee <stolee@gmail.com>
Cc: Elijah Newren <newren@gmail.com>,
	JunkYardMail1 <JunkYardMail1@frontier.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Sparse Checkout Trouble (2.5.0)
Date: Wed, 29 Jan 2020 16:30:35 +0100 (CET)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.2001291626550.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <e4bb20e9-ad90-3e9b-7ed2-c7793cb8cb22@gmail.com>

Hi,

On Tue, 28 Jan 2020, Derrick Stolee wrote:

> On 1/28/2020 12:21 AM, Elijah Newren wrote:
> > On Sun, Jan 26, 2020 at 6:09 AM Derrick Stolee <stolee@gmail.com> wrote:
> >>
> >> On 1/25/2020 3:59 PM, Elijah Newren wrote:
> >>> On Fri, Jan 24, 2020 at 7:41 AM Derrick Stolee <stolee@gmail.com> wrote:
> >>>> I'm CC'ing Elijah because he also made changes to dir.c, and
> >>>> perhaps he has some idea of what's going on.
> >>>
> >>> If you think it might be related to the dir.c changes, I can take a
> >>> look.  I don't have any immediate ideas off the top of my head.
> >>
> >> The only thing I can think of is that these paths are already
> >> marked as sparse, but something is requiring us to test if the
> >> path can be created with the filesystem. I'll try to debug
> >> more into exactly where that is. It's telling that this happens
> >> both in cone mode and without.
> >
> > Yeah, I'll take a look.  The exponentially slow 'status --ignored'
> > report is forcing me to look at dir.c again anyway, though it's also
> > delaying me from getting a chance to look at this particular report.
>
> I made some progress, at least, in root-causing the issue.
> The problem bisects down to 4dc42c6c1 (mingw: refuse paths
> containing reserved names, 2019-12-21) [1]. CC'ing Dscho.
>
> That commit updates is_valid_win32_path() to fail on these
> paths. We were _already_ calling this method even for paths
> outside the sparse cone, but the method didn't fail for these
> examples.
>
> This means the fix is probably even more complicated: we need
> to not call this method when traversing paths that have the
> skip-worktree bit enabled. This may lead to some tiny
> performance gains when hydrating a very small fraction of a
> very large index.

Hmm. I am actually not sure that this would be a fix. It is all too easy
for a skip-worktree entry to become checked out (think e.g. a merge
conflict in a cherry-pick, during a three-way merge of a file that is not
in the cone but still needs to be handled).

My preferred solution for this issue would be for the files/directories to
be renamed using `git -c core.protectntfs=false mv <reserved-name>
<non-reserved-name>`.

I think if we try to play extra games with the skip-worktree bit, we risk
opening a vulnerability again.

Ciao,
Dscho

>
> Thanks,
> -Stolee
>
> [1] http://github.com/git/git/commit/4dc42c6c1867a52e22f1f04a1a247b5a7538b8af
>

  reply	other threads:[~2020-01-29 15:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-22  0:42 Sparse Checkout Trouble (2.5.0) JunkYardMail1
2020-01-22  1:19 ` Derrick Stolee
2020-01-22  2:06   ` JunkYardMail1
2020-01-24 15:40   ` Derrick Stolee
2020-01-25 20:59     ` Elijah Newren
2020-01-26 14:09       ` Derrick Stolee
2020-01-28  5:21         ` Elijah Newren
2020-01-28 20:47           ` Derrick Stolee
2020-01-29 15:30             ` Johannes Schindelin [this message]
2020-01-29 15:40               ` Derrick Stolee
2020-01-29 16:31                 ` Derrick Stolee

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=nycvar.QRO.7.76.6.2001291626550.46@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=JunkYardMail1@frontier.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=stolee@gmail.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.
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).