From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Hocko Date: Thu, 12 Jan 2017 19:33:27 +0000 Subject: Re: [patch linux-next] userfaultfd: hugetlbfs: unmap the correct pointer Message-Id: <20170112193327.GB8558@dhcp22.suse.cz> List-Id: References: <20170112192052.GB12157@mwanda> In-Reply-To: <20170112192052.GB12157@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter Cc: Andrew Morton , Mike Kravetz , "Kirill A. Shutemov" , Jan Kara , Ross Zwisler , Lorenzo Stoakes , "Aneesh Kumar K.V" , Dan Williams , linux-mm@kvack.org, kernel-janitors@vger.kernel.org On Thu 12-01-17 22:20:52, Dan Carpenter wrote: > kunmap_atomic() and kunmap() take different pointers. People often get > these mixed up. > > Fixes: 16374db2e9a0 ("userfaultfd: hugetlbfs: fix __mcopy_atomic_hugetlb retry/error processing") This looks like a linux-next sha1. This is not stable and will change... > Signed-off-by: Dan Carpenter > > diff --git a/mm/memory.c b/mm/memory.c > index 6012a05..dfd3604 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -4172,7 +4172,7 @@ long copy_huge_page_from_user(struct page *dst_page, > (const void __user *)(src + i * PAGE_SIZE), > PAGE_SIZE); > if (allow_pagefault) > - kunmap(page_kaddr); > + kunmap(dst_page + 1); I guess you meant dst_page + i > else > kunmap_atomic(page_kaddr); > -- Michal Hocko SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f72.google.com (mail-wm0-f72.google.com [74.125.82.72]) by kanga.kvack.org (Postfix) with ESMTP id C8A346B0253 for ; Thu, 12 Jan 2017 14:33:32 -0500 (EST) Received: by mail-wm0-f72.google.com with SMTP id p192so7968865wme.1 for ; Thu, 12 Jan 2017 11:33:32 -0800 (PST) Received: from mx2.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id y23si8285435wra.86.2017.01.12.11.33.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 12 Jan 2017 11:33:31 -0800 (PST) Date: Thu, 12 Jan 2017 20:33:27 +0100 From: Michal Hocko Subject: Re: [patch linux-next] userfaultfd: hugetlbfs: unmap the correct pointer Message-ID: <20170112193327.GB8558@dhcp22.suse.cz> References: <20170112192052.GB12157@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170112192052.GB12157@mwanda> Sender: owner-linux-mm@kvack.org List-ID: To: Dan Carpenter Cc: Andrew Morton , Mike Kravetz , "Kirill A. Shutemov" , Jan Kara , Ross Zwisler , Lorenzo Stoakes , "Aneesh Kumar K.V" , Dan Williams , linux-mm@kvack.org, kernel-janitors@vger.kernel.org On Thu 12-01-17 22:20:52, Dan Carpenter wrote: > kunmap_atomic() and kunmap() take different pointers. People often get > these mixed up. > > Fixes: 16374db2e9a0 ("userfaultfd: hugetlbfs: fix __mcopy_atomic_hugetlb retry/error processing") This looks like a linux-next sha1. This is not stable and will change... > Signed-off-by: Dan Carpenter > > diff --git a/mm/memory.c b/mm/memory.c > index 6012a05..dfd3604 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -4172,7 +4172,7 @@ long copy_huge_page_from_user(struct page *dst_page, > (const void __user *)(src + i * PAGE_SIZE), > PAGE_SIZE); > if (allow_pagefault) > - kunmap(page_kaddr); > + kunmap(dst_page + 1); I guess you meant dst_page + i > else > kunmap_atomic(page_kaddr); > -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org