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:   Fri, 31 Aug 2018 13:17:20 -0700
From:   Greg Hackmann <ghackmann@...gle.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Greg Hackmann <ghackmann@...roid.com>
Cc:     linux-kernel@...r.kernel.org, Laura Abbott <labbott@...hat.com>,
        Sumit Semwal <sumit.semwal@...aro.org>,
        devel@...verdev.osuosl.org, kernel-team@...roid.com,
        stable@...r.kernel.org
Subject: Re: [PATCH] staging: android: ion: fix ION_IOC_{MAP,SHARE}
 use-after-free

On 08/31/2018 01:12 PM, Greg Kroah-Hartman wrote:
> On Fri, Aug 31, 2018 at 01:06:27PM -0700, Greg Hackmann wrote:
>> The ION_IOC_{MAP,SHARE} ioctls drop and reacquire client->lock several
>> times while operating on one of the client's ion_handles.  This creates
>> windows where userspace can call ION_IOC_FREE on the same client with
>> the same handle, and effectively make the kernel drop its own reference.
>> For example:
>>
>> - thread A: ION_IOC_ALLOC creates an ion_handle with refcount 1
>> - thread A: starts ION_IOC_MAP and increments the refcount to 2
>> - thread B: ION_IOC_FREE decrements the refcount to 1
>> - thread B: ION_IOC_FREE decrements the refcount to 0 and frees the
>>             handle
>> - thread A: continues ION_IOC_MAP with a dangling ion_handle * to
>>             freed memory
>>
>> Fix this by holding client->lock for the duration of
>> ION_IOC_{MAP,SHARE}, preventing the concurrent ION_IOC_FREE.  Also
>> remove ion_handle_get_by_id(), since there's literally no way to use it
>> safely.
>>
>> This patch is applied on top of 4.9.y.  Kernels 4.12 and later are
>> unaffected, since all the underlying ion_handle infrastructure has been
>> ripped out.
> 
> Does 4.4.y or older also need this?  If so, can you send backports, as
> this one does not apply there.
> 
> thanks,
> 
> greg k-h
> 

Yes, 4.4.y and older will need this.  If there are no objections to this
patch, I'll send backports ASAP.

Powered by blists - more mailing lists