lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 2 Jan 2019 19:32:08 -0800
From:   John Hubbard <jhubbard@...dia.com>
To:     Jerome Glisse <jglisse@...hat.com>,
        Matthew Wilcox <willy@...radead.org>
CC:     Andrew Morton <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
        <linux-xfs@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Christian König <christian.koenig@....com>,
        Jan Kara <jack@...e.cz>
Subject: Re: [PATCH] Initialise mmu_notifier_range correctly

On 1/2/19 5:56 PM, Jerome Glisse wrote:
> On Wed, Jan 02, 2019 at 04:21:26PM -0800, Matthew Wilcox wrote:
>>
>> One of the paths in follow_pte_pmd() initialised the mmu_notifier_range
>> incorrectly.
>>
>> Signed-off-by: Matthew Wilcox <willy@...radead.org>
>> Fixes: ac46d4f3c432 ("mm/mmu_notifier: use structure for invalidate_range_start/end calls v2")
>> Tested-by: Dave Chinner <dchinner@...hat.com>
> 
> Reviewed-by: Jérôme Glisse <jglisse@...hat.com>
> 
>>
>> diff --git a/mm/memory.c b/mm/memory.c
>> index 2dd2f9ab57f4..21a650368be0 100644
>> --- a/mm/memory.c
>> +++ b/mm/memory.c
>> @@ -4078,8 +4078,8 @@ static int __follow_pte_pmd(struct mm_struct *mm, unsigned long address,
>>  		goto out;
>>  
>>  	if (range) {
>> -		range->start = address & PAGE_MASK;
>> -		range->end = range->start + PAGE_SIZE;
>> +		mmu_notifier_range_init(range, mm, address & PAGE_MASK,
>> +				     (address & PAGE_MASK) + PAGE_SIZE);
>>  		mmu_notifier_invalidate_range_start(range);
>>  	}
>>  	ptep = pte_offset_map_lock(mm, pmd, address, ptlp);
> 

Looks correct to me, as well.

Having the range struct declared in separate places from the mmu_notifier_range_init()
calls is not great. But I'm not sure I see a way to make it significantly cleaner, given
that __follow_pte_pmd uses the range pointer as a way to decide to issue the mmn calls.


thanks,
-- 
John Hubbard
NVIDIA

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ