diff options
| author | Matthew Wilcox (Oracle) <[email protected]> | 2022-06-12 21:32:25 +0000 |
|---|---|---|
| committer | Kees Cook <[email protected]> | 2022-06-13 16:54:52 +0000 |
| commit | 993d0b287e2ef7bee2e8b13b0ce4d2b5066f278e (patch) | |
| tree | 853081efc2b49076ac29148901f66752393130ae /mm/vmalloc.c | |
| parent | cfi: Fix __cfi_slowpath_diag RCU usage with cpuidle (diff) | |
| download | kernel-993d0b287e2ef7bee2e8b13b0ce4d2b5066f278e.tar.gz kernel-993d0b287e2ef7bee2e8b13b0ce4d2b5066f278e.zip | |
usercopy: Handle vm_map_ram() areas
vmalloc does not allocate a vm_struct for vm_map_ram() areas. That causes
us to deny usercopies from those areas. This affects XFS which uses
vm_map_ram() for its directories.
Fix this by calling find_vmap_area() instead of find_vm_area().
Fixes: 0aef499f3172 ("mm/usercopy: Detect vmalloc overruns")
Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
Reviewed-by: Uladzislau Rezki (Sony) <[email protected]>
Tested-by: Zorro Lang <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'mm/vmalloc.c')
| -rw-r--r-- | mm/vmalloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 07db42455dd4..effd1ff6a4b4 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -1798,7 +1798,7 @@ static void free_unmap_vmap_area(struct vmap_area *va) free_vmap_area_noflush(va); } -static struct vmap_area *find_vmap_area(unsigned long addr) +struct vmap_area *find_vmap_area(unsigned long addr) { struct vmap_area *va; |
