[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201005174747.GA15803@nvidia.com>
Date: Mon, 5 Oct 2020 14:47:47 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: andrew Morton <akpm@...ux-foundation.org>,
Daniel Vetter <daniel.vetter@...ll.ch>, <linux-mm@...ck.org>
CC: Hans Verkuil <hans.verkuil@...co.com>, Jan Kara <jack@...e.cz>,
"Mauro Carvalho Chehab" <mchehab@....samsung.com>,
Mel Gorman <mgorman@...e.de>, <stable@...r.kernel.org>,
Vlastimil Babka <vbabka@...e.cz>,
John Hubbard <jhubbard@...dia.com>,
DRI Development <dri-devel@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>,
Dan Williams <dan.j.williams@...el.com>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
linux-samsung-soc <linux-samsung-soc@...r.kernel.org>,
<linux-media@...r.kernel.org>
Subject: Re: [PATCH 2/2] mm/frame-vec: use FOLL_LONGTERM
On Mon, Oct 05, 2020 at 02:38:54PM -0300, Jason Gunthorpe wrote:
> When get_vaddr_frames() does its hacky follow_pfn() loop it should never
> be allowed to extract a struct page from a normal VMA. This could allow a
> serious use-after-free problem on any kernel memory.
>
> Restrict this to only work on VMA's with one of VM_IO | VM_PFNMAP
> set. This limits the use-after-free problem to only IO memory, which while
> still serious, is an improvement.
>
> Cc: stable@...r.kernel.org
> Fixes: 8025e5ddf9c1 ("[media] mm: Provide new get_vaddr_frames() helper")
> Signed-off-by: Jason Gunthorpe <jgg@...dia.com>
> ---
> mm/frame_vector.c | 4 ++++
> 1 file changed, 4 insertions(+)
woops, this subject got badly corrupted when I was editing the CC
list, it was supposed to be:
[PATCH] mm/gpu: frame_vector: require all VMAs to be VM_PFNMAP
Andrew please let me know if you need a resend
Sorry,
Jason
Powered by blists - more mailing lists