mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
If some remap_pfn_range() calls succeeded before one failed, we still have buffer pages mapped into the userspace page tables when we drop the buffer reference with comedi_buf_map_put(bm). The userspace mappings are only cleaned up later in the mmap error path. Fix it by explicitly flushing all mappings in our VMA on the error path. See commit79a61cc3fc("mm: avoid leaving partial pfn mappings around in error case"). Cc: stable@vger.kernel.org Fixes:ed9eccbe89("Staging: add comedi core") Signed-off-by: Jann Horn <jannh@google.com> Link: https://lore.kernel.org/r/20241017-comedi-tlb-v3-1-16b82f9372ce@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>