[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YqcKw4AxxvEWtLmS@pc638.lan>
Date: Mon, 13 Jun 2022 12:00:35 +0200
From: Uladzislau Rezki <urezki@...il.com>
To: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Cc: Kees Cook <keescook@...omium.org>, linux-mm@...ck.org,
Uladzislau Rezki <urezki@...il.com>,
Zorro Lang <zlang@...hat.com>, linux-xfs@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH 1/3] 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) <willy@...radead.org>
> ---
> include/linux/vmalloc.h | 1 +
> mm/usercopy.c | 8 +++++---
> mm/vmalloc.c | 2 +-
> 3 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
> index b159c2789961..096d48aa3437 100644
> --- a/include/linux/vmalloc.h
> +++ b/include/linux/vmalloc.h
> @@ -215,6 +215,7 @@ extern struct vm_struct *__get_vm_area_caller(unsigned long size,
> void free_vm_area(struct vm_struct *area);
> extern struct vm_struct *remove_vm_area(const void *addr);
> extern struct vm_struct *find_vm_area(const void *addr);
> +struct vmap_area *find_vmap_area(unsigned long addr);
Make it "extern" since it becomes globally visible?
--
Uladzislau Rezki
Powered by blists - more mailing lists