Re: [patch v2 linux-next] userfaultfd: hugetlbfs: unmap the correct pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/13/2017 12:40 AM, Michal Hocko wrote:
> On Fri 13-01-17 11:26:08, 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")
>> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> Acked-by: Michal Hocko <mhocko@xxxxxxxx>

Thanks for catching this!

Reviewed-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx>

-- 
Mike Kravetz

> 
>> ---
>> v2: I was also unmapping the wrong pointer because I had a typo.
>>
>> diff --git a/mm/memory.c b/mm/memory.c
>> index 6012a05..aca8ef6 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(page_kaddr + i);
>>  		else
>>  			kunmap_atomic(page_kaddr);
>>  
> 
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux