diff options
| author | Karl Mehltretter <kmehltretter@gmail.com> | 2026-10-06 06:51:36 +0200 |
|---|---|---|
| committer | Namjae Jeon <linkinjeon@kernel.org> | 2026-10-20 18:41:55 +0900 |
| commit | a5ec71084996aec76d07e0e530a345cdd202dc1a (patch) | |
| tree | 0860396ff7bf74d63bbda2275a2a041ddfc906c0 /scripts/Makefile.thinlto | |
| parent | 16fcb1c446f17c11c104bd4e631b841946d180aa (diff) | |
| download | linux-a5ec71084996aec76d07e0e530a345cdd202dc1a.tar.gz linux-a5ec71084996aec76d07e0e530a345cdd202dc1a.zip | |
ntfs: fix kmap_local leak in ntfs_check_logfile()
ntfs_check_logfile() calls kmap_local_folio() on every iteration of its
search loop but kunmap_local() only once per folio. The loop visits
positions 0, 512, 1024, 2048, 4096 and so on. With 4 KiB pages the first
four are in one page, so a mount whose first LogFile folio is in highmem
leaves three entries on the kmap_local stack of the mounting task.
Kernels without HIGHMEM are not affected.
The leaked entries keep migration disabled. nr_pinned of the runqueue
the mount ran on stays raised after the task exits, so taking that CPU
offline blocks forever in balance_hotplug_wait().
The fifth mount in one task reaches KM_MAX_IDX (12 leaked entries plus
4 in the loop) and hits the BUG_ON() in kmap_local_idx_push():
kernel BUG at mm/highmem.c:480!
On x86-32 the generic entry code also warns on return to user space:
DEBUG_LOCKS_WARN_ON(current->kmap_ctrl.idx)
WARNING: include/linux/highmem-internal.h:17 at __do_fast_syscall_32+0x21e/0x550
Map each page once, when it is read, and unmap that address.
Fixes: 5218cd102aec ("ntfs: update misc operations")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
