mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] ntfs: enforce the encrypted-file policy on the read paths
@ 2026-10-12  6:20 Zhan Xusheng
  2026-10-12  6:20 ` [PATCH 1/2] ntfs: do not read ahead encrypted files Zhan Xusheng
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Zhan Xusheng @ 2026-10-12  6:20 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: Hyunchul Lee, ntfs, linux-kernel, Zhan Xusheng

From: Zhan Xusheng <zhanxusheng@xiaomi.com>

EFS-encrypted attributes are refused with -EOPNOTSUPP in exactly one
place, ntfs_read_folio(), because decryption is not implemented.  Two
read paths get there without passing that test and return the raw
on-disk ciphertext instead, so the same read returns either ciphertext
or -EOPNOTSUPP depending on which path serves it.

Patch 1 is readahead, which marks the folios uptodate so ->read_folio
is never called.  read(), mmap(), splice() and fadvise() all populate
the page cache this way, so one test closes all four.

Patch 2 is direct I/O, which bypasses the page cache entirely and has
no such backstop.

Both commits are in v7.1.  I have not added Cc: stable; returning
ciphertext rather than an error is a correctness bug but not a
privilege boundary crossing, so that call is better made by the
maintainers.

Found by reading the code.  I have no EFS-encrypted NTFS volume, so
there is no reproducer; the paths were traced in the source.

Zhan Xusheng (2):
  ntfs: do not read ahead encrypted files
  ntfs: reject direct I/O reads of encrypted files

 fs/ntfs/aops.c | 7 ++++---
 fs/ntfs/file.c | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)


base-commit: d6d3455d8751854e0d1820f14184682e23ac4475
-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-10-12 11:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-12  6:20 [PATCH 0/2] ntfs: enforce the encrypted-file policy on the read paths Zhan Xusheng
2026-10-12  6:20 ` [PATCH 1/2] ntfs: do not read ahead encrypted files Zhan Xusheng
2026-10-12  8:49   ` liubaolin
2026-10-12  6:20 ` [PATCH 2/2] ntfs: reject direct I/O reads of " Zhan Xusheng
2026-10-12  8:49   ` liubaolin
2026-10-12  8:50 ` [PATCH 0/2] ntfs: enforce the encrypted-file policy on the read paths liubaolin
2026-10-12 10:01 ` Hyunchul Lee
2026-10-12 11:58 ` Namjae Jeon

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®