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]
Message-ID: <4eac810c-60e5-409d-a4a3-452461ace9bb@redhat.com>
Date: Tue, 12 Nov 2024 15:53:51 +0100
From: David Hildenbrand <david@...hat.com>
To: Carlos Llamas <cmllamas@...gle.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 Arve Hjønnevåg <arve@...roid.com>,
 Todd Kjos <tkjos@...roid.com>, Martijn Coenen <maco@...roid.com>,
 Joel Fernandes <joel@...lfernandes.org>,
 Christian Brauner <brauner@...nel.org>,
 Suren Baghdasaryan <surenb@...gle.com>, linux-kernel@...r.kernel.org,
 kernel-team@...roid.com, Barry Song <v-songbaohua@...o.com>,
 "Liam R. Howlett" <Liam.Howlett@...cle.com>
Subject: Re: [PATCH v3 2/8] binder: concurrent page installation

On 12.11.24 15:43, Carlos Llamas wrote:
> On Tue, Nov 12, 2024 at 12:10:20PM +0100, David Hildenbrand wrote:
>> On 08.11.24 20:10, Carlos Llamas wrote:
>>> +	ret = vm_insert_page(vma, addr, page);
>>> +	switch (ret) {
>>> +	case -EBUSY:
>>> +		/*
>>> +		 * EBUSY is ok. Someone installed the pte first but the
>>> +		 * lru_page->page_ptr has not been updated yet. Discard
>>> +		 * our page and look up the one already installed.
>>> +		 */
>>> +		ret = 0;
>>> +		__free_page(page);
>>> +		npages = get_user_pages_remote(alloc->mm, addr, 1, 0, &page, NULL);
>>
>> This will trigger a page fault if we don't find what we expect (are races
>> with e.g., MADV_DONTNEED possible?), is that really desired or not a
>> problem?
> 
> This is fine. As of now, binder blocks its page faults:
> 
> 	static vm_fault_t binder_vm_fault(struct vm_fault *vmf)
> 	{
> 		return VM_FAULT_SIGBUS;
> 	}
> 
> If we race with something like MADV_DONTNEED then we would just
> propagate the -EFAULT error. I could add FOLL_NOFAULT to the gup remote
> call to make it evident we don't care though.

Might make it clearer ... or at least adding a comment how this is 
supposed to work. :)

-- 
Cheers,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ