From: Reid Downing <skibletz@gmail.com>
To: linkinjeon@kernel.org, sj1557.seo@samsung.com
Cc: yuezhang.mo@sony.com, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, Reid Downing <skibletz@gmail.com>
Subject: [PATCH] exfat: fix upcase table validation to require all entries consumed
Date: Sun, 25 Oct 2026 08:26:39 -0400 [thread overview]
Message-ID: <20261025122639.1173247-1-skibletz@gmail.com> (raw)
exfat_load_upcase_table() and exfat_load_default_upcase_table()
accept the table when index >= 0xFFFF, but a correct table must
process all 0x10000 entries, leaving index at 0x10000.
a crafted filesystem image can use the compressed skip encoding
to advance index to exactly 0xFFFF without filling the remaining
entries. the checksum covers only the on-disk bytes so it can be
made to match. the kernel accepts the table while the unfilled
entries silently remain zero, causing incorrect uppercase mappings
for the affected codepoints and breaking case-insensitive filename
comparison for non-ascii characters.
fix both checks to require index >= UTBL_COUNT.
Fixes: 370e812b3ec1 ("exfat: add nls operations")
Signed-off-by: Reid Downing <skibletz@gmail.com>
---
fs/exfat/nls.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/exfat/nls.c b/fs/exfat/nls.c
index 055447edc..7afc86ea2 100644
--- a/fs/exfat/nls.c
+++ b/fs/exfat/nls.c
@@ -691,7 +691,7 @@ static int exfat_load_upcase_table(struct super_block *sb,
brelse(bh);
}
- if (index >= 0xFFFF && utbl_checksum == chksum)
+ if (index >= UTBL_COUNT && utbl_checksum == chksum)
return 0;
exfat_err(sb, "failed to load upcase table (idx : 0x%08x, chksum : 0x%08x, utbl_chksum : 0x%08x)",
@@ -728,7 +728,7 @@ static int exfat_load_default_upcase_table(struct super_block *sb)
}
}
- if (index >= 0xFFFF)
+ if (index >= UTBL_COUNT)
return 0;
/* FATAL error: default upcase table has error */
--
2.53.0
next reply other threads:[~2026-10-25 12:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 12:26 Reid Downing [this message]
2026-10-27 8:01 ` David Timber
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=20261025122639.1173247-1-skibletz@gmail.com \
--to=skibletz@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sj1557.seo@samsung.com \
--cc=yuezhang.mo@sony.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®