Re: [PATCH] vmacache: change vmacache_find() to always check ->vm_mm

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

 



On 04/29, Srivatsa S. Bhat wrote:
>
> On 04/29/2014 06:22 PM, Oleg Nesterov wrote:
> > On 04/29, Srivatsa S. Bhat wrote:
> >>
> >> I guess I'll hold off on testing this fix until I get to reproduce
> >> the bug more reliably..
> >
> > perhaps the patch below can help a bit?
> >
> > -------------------------------------------------------------------------------
> > Subject: [PATCH] vmacache: change vmacache_find() to always check ->vm_mm
> >
> > If ->vmacache was corrupted it would be better to detect and report
> > the problem asap, check vma->vm_mm before vm_start/vm_end.
> >
> > Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
> > ---
> >  mm/vmacache.c |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/mm/vmacache.c b/mm/vmacache.c
> > index d4224b3..952a324 100644
> > --- a/mm/vmacache.c
> > +++ b/mm/vmacache.c
> > @@ -81,9 +81,10 @@ struct vm_area_struct *vmacache_find(struct mm_struct *mm, unsigned long addr)
> >  	for (i = 0; i < VMACACHE_SIZE; i++) {
> >  		struct vm_area_struct *vma = current->vmacache[i];
> >
> > -		if (vma && vma->vm_start <= addr && vma->vm_end > addr) {
> > +		if (vma) {
> >  			BUG_ON(vma->vm_mm != mm);
> > -			return vma;
> > +			if (vma->vm_start <= addr && vma->vm_end > addr)
> > +				return vma;
> >  		}
> >  	}
> >
>
> IIUC, this is similar to commit 50f5aa8a9b2 (mm: don't pointlessly use
> BUG_ON() for sanity check).

Yes, I see this commit after git-pull ;)

Please ignore then.

> But even with that commit included I was
> not able to reproduce the bug again, as reported here:
>
> https://lkml.org/lkml/2014/4/29/187

Thanks...

Oleg.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]