lkml.org 
[lkml]   [2022]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/7] binder: fix alloc->vma_vm_mm null-ptr dereference
Date
* Carlos Llamas <cmllamas@google.com> [220830 15:41]:
> On Tue, Aug 30, 2022 at 07:06:37PM +0000, Liam Howlett wrote:
> > > diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
> > > index 51f4e1c5cd01..9b1778c00610 100644
> > > --- a/drivers/android/binder_alloc.c
> > > +++ b/drivers/android/binder_alloc.c
> > > @@ -322,7 +322,6 @@ static inline void binder_alloc_set_vma(struct binder_alloc *alloc,
> > > */
> > > if (vma) {
> > > vm_start = vma->vm_start;
> > > - alloc->vma_vm_mm = vma->vm_mm;
> >
> > Is this really the null pointer dereference? We check for vma above..?
> >
>
> Not here. The sequence leading to the null-ptr-deref happens when we try
> to take alloc->vma_vm_mm->mmap_lock in binder_alloc_new_buf_locked() and
> in binder_alloc_print_pages() without initializing alloc->vma_vm_mm
> first (e.g. mmap() was never called). These sequences are described in
> the commit message but basically they translate to mmap_read_lock(NULL)
> calls.

Ah, this is unnecessary with the rest of the change.

Feel free to add my reviewed-by if you want.


Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>

\
 
 \ /
  Last update: 2022-08-30 22:31    [W:0.085 / U:3.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site