public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-xfs@vger.kernel.org, david@fromorbit.com
Subject: Re: [PATCH 1/3] xfs: stabilize the tolower function used for ascii-ci dir hash computation
Date: Wed, 5 Apr 2023 10:10:26 -0700	[thread overview]
Message-ID: <20230405171026.GH303486@frogsfrogsfrogs> (raw)
In-Reply-To: <ZC2W6jZ1LI12swSY@infradead.org>

On Wed, Apr 05, 2023 at 08:42:34AM -0700, Christoph Hellwig wrote:
> On Wed, Apr 05, 2023 at 08:40:22AM -0700, Darrick J. Wong wrote:
> > <shrug> Welllll... if someone presents a strong case for adopting the
> > utf8 casefolding feature that f2fs and ext4 added some ways back, I
> > could be persuaded to import that, bugs and all, into XFS.  However,
> > given all the weird problems I've uncovered with "ascii"-ci, I'm going
> > to be very hardnosed about adding test cases and making sure /all/ the
> > tooling works properly.
> 
> You'll love this paper:
> 
> https://www.usenix.org/conference/fast23/presentation/basu

I know.

I stick to my earlier statements about "I wouldn't ever enable this
feature on any computer I use..." and "...not a tarpit that I ever want
to visit in XFS."

At one point I had wired up xfs_scrub to complain about filenames that
map to the same casefolded utf8 names to warn syadmins that this could
be used in some sort of unicode casefolding attack.  I pushed it back on
my patch stack and ran it against /home today and got a bunch of stuff
like this from the kernel source tree:

Warning: inode 4187068442 (31/26318874): Case-folded Unicode name "ip6t_hl.h" in directory could be confused with "ip6t_HL.h". (unicrash.c line 614)
Warning: inode 4032422946 (30/5891106): Case-folded Unicode name "ipt_ecn.h" in directory could be confused with "ipt_ECN.h". (unicrash.c line 614)
Warning: inode 4032422946 (30/5891106): Case-folded Unicode name "ipt_ttl.h" in directory could be confused with "ipt_TTL.h". (unicrash.c line 614)
Warning: inode 2285477942 (17/3776566): Case-folded Unicode name "xt_hl.c" in directory could be confused with "xt_HL.c". (unicrash.c line 614)
Warning: inode 2285477942 (17/3776566): Case-folded Unicode name "xt_tcpmss.c" in directory could be confused with "xt_TCPMSS.c". (unicrash.c line 614)
Warning: inode 3627924489 (27/4045833): Case-folded Unicode name "xt_tcpmss.h" in directory could be confused with "xt_TCPMSS.h". (unicrash.c line 614)
Warning: inode 3763353714 (28/5257330): Case-folded Unicode name "ip6t_hl.h" in directory could be confused with "ip6t_HL.h". (unicrash.c line 614)
Warning: inode 3763353714 (28/5257330): Case-folded Unicode name ".ip6t_hl.h.cmd" in directory could be confused with ".ip6t_HL.h.cmd". (unicrash.c line 614)
Warning: inode 7042717 (0/7042717): Case-folded Unicode name ".ipt_ecn.h.cmd" in directory could be confused with ".ipt_ECN.h.cmd". (unicrash.c line 614)
Warning: inode 7042717 (0/7042717): Case-folded Unicode name ".ipt_ttl.h.cmd" in directory could be confused with ".ipt_TTL.h.cmd". (unicrash.c line 614)
Warning: inode 7042718 (0/7042718): Case-folded Unicode name "ip6t_hl.h" in directory could be confused with "ip6t_HL.h". (unicrash.c line 614)
Warning: inode 7042718 (0/7042718): Case-folded Unicode name ".ip6t_hl.h.cmd" in directory could be confused with ".ip6t_HL.h.cmd". (unicrash.c line 614)
Warning: inode 406880264 (3/4227080): Case-folded Unicode name "Z6.0+pooncelock+pooncelock+pombonce.litmus" in directory could be confused with "Z6.0+pooncelock+poonceLock+pombonce.litmus". (unicrash.c line 614)

Yuck.

I never sent this patch to linux-xfs because XFS doesn't do casefolding
so who cares.  The xtables stuff is easy to spot, but that last one took
some staring before I even figured out what was different between the
two names -- lock vs Lock.

--D

  reply	other threads:[~2023-04-05 17:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04 17:07 [PATCHSET 0/3] xfs: fix ascii-ci problems with userspace Darrick J. Wong
2023-04-04 17:07 ` [PATCH 1/3] xfs: stabilize the tolower function used for ascii-ci dir hash computation Darrick J. Wong
2023-04-04 17:54   ` Linus Torvalds
2023-04-04 18:32     ` Darrick J. Wong
2023-04-04 18:58       ` Linus Torvalds
2023-04-04 23:30       ` Dave Chinner
2023-04-05  0:17         ` Linus Torvalds
2023-04-05  6:12       ` Christoph Hellwig
2023-04-05 15:40         ` Darrick J. Wong
2023-04-05 15:42           ` Christoph Hellwig
2023-04-05 17:10             ` Darrick J. Wong [this message]
2023-04-05 10:48   ` Christoph Hellwig
2023-04-05 15:30     ` Darrick J. Wong
2023-04-05 15:45       ` Linus Torvalds
2023-04-04 17:07 ` [PATCH 2/3] xfs: test the ascii case-insensitive hash Darrick J. Wong
2023-04-04 18:06   ` Linus Torvalds
2023-04-04 20:51     ` Darrick J. Wong
2023-04-04 21:21       ` Linus Torvalds
2023-04-05  6:15         ` Christoph Hellwig
2023-04-04 17:07 ` [PATCH 3/3] xfs: use the directory name hash function for dir scrubbing Darrick J. Wong
2023-04-04 17:17 ` [PATCHSET 0/3] xfs: fix ascii-ci problems with userspace Darrick J. Wong
2023-04-04 18:19   ` Linus Torvalds
2023-04-04 20:21     ` Linus Torvalds
2023-04-04 21:00       ` Darrick J. Wong
2023-04-04 21:50         ` Linus Torvalds
2023-04-04 21:09 ` [PATCH] xfstests: add a couple more tests for ascii-ci problems Darrick J. Wong

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=20230405171026.GH303486@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --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