OpenCloudOS-Kernel/drivers/comedi
Jann Horn 9b07fb464e comedi: Flush partial mappings in error case
commit ce8f9fb651fac95dd41f69afe54d935420b945bd upstream.

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 commit 79a61cc3fc04 ("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>
2024-12-09 10:32:44 +01:00
..
drivers comedi: ni_routing: tools: Check when the file could not be opened 2024-10-17 15:24:20 +02:00
kcomedilib comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
Kconfig Revert "comedi: add HAS_IOPORT dependencies" 2023-09-12 15:49:20 +02:00
Makefile
TODO
comedi_buf.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
comedi_fops.c comedi: Flush partial mappings in error case 2024-12-09 10:32:44 +01:00
comedi_internal.h
comedi_pci.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
comedi_pcmcia.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
comedi_usb.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
drivers.c drivers: comedi: replace ternary operator with min() 2022-05-19 18:54:45 +02:00
proc.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00
range.c comedi: Move the main COMEDI headers 2021-11-26 16:48:59 +01:00