diff options
| author | Weiming Shi <bestswngs@gmail.com> | 2026-07-12 06:34:26 -0700 |
|---|---|---|
| committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2026-10-13 15:44:59 +0200 |
| commit | 80218408836fa6fc91a9c26a9c014f81abf9e41f (patch) | |
| tree | 911420f4ab8d975243bc130213fa1968df089e15 /tools/lib/python | |
| parent | 2727ac2ba87af3d5469a17648207fcfd72f6be7f (diff) | |
| download | linux-next-80218408836fa6fc91a9c26a9c014f81abf9e41f.tar.gz linux-next-80218408836fa6fc91a9c26a9c014f81abf9e41f.zip | |
fs/ntfs3: do not mark frame pages uptodate on read error
ni_read_frame() ends with a loop that marks every page of a compressed
frame uptodate regardless of whether the read succeeded:
out:
for (i = 0; i < pages_per_frame; i++) {
pg = pages[i];
SetPageUptodate(pg);
}
Non-critical frame pages come from __filemap_get_folio(FGP_CREAT) and are
not zeroed. On an error path that reaches out: before frame_mem is
written, these pages keep uninitialized page-allocator contents but are
still marked uptodate. A later read() is then served from the page cache
and returns that stale kernel memory to user space.
For an unprivileged user mounting a crafted NTFS image this is a
repeatable kernel memory disclosure.
Mark the pages uptodate only on success; on error leave them !uptodate so
the read path re-reads them or reports the error.
Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation")
Reported-by: Xiang Mei <xmei5@asu.edu>
Signed-off-by: Weiming Shi <bestswngs@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
