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, 9 Apr 2010 09:35:15 -0700 (PDT)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Borislav Petkov <bp@...en8.de>
cc:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Rik van Riel <riel@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Minchan Kim <minchan.kim@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Lee Schermerhorn <Lee.Schermerhorn@...com>,
	Nick Piggin <npiggin@...e.de>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Hugh Dickins <hugh.dickins@...cali.co.uk>,
	sgunderson@...foot.com, hannes@...xchg.org
Subject: Re: [PATCH -v2] rmap: make anon_vma_prepare link in all the anon_vmas
 of a mergeable VMA



On Fri, 9 Apr 2010, Borislav Petkov wrote:
> 
> So I went and reapplied the three patches (3rd is the object_err export
> for SLUB debugging) on a new branch of today's git - same results, the
> same processes crap up in the WARN(!vma->anon_vma) check so it should be
> something else we're missing.
> 
> More code staring later...

Can you try with _just_ my patch? Or add a 

	vma->anon_vma = merge_vma->anon_vma;

to Rik's "merge_vma" case in anon_vma_prepare().

Because I'm starign at Rik's patch, and one thing strikes me: it does that 
"anon_vma_clone()" in anon_vma_prepare(), and maybe I'm blind, but I don't 
see where that actually sets vma->anon_vma.

As far as I can tell, anon_vma_clone() was designed purely for the fork() 
case, which has done

	*new = *vma;

which will set new->anon_vma to the same vma. But Rik's patch never does 
that for the anon_vma_prepare() case.

And maybe we should do it in anon_vma_clone() itself, just to make it 
impossible to mistakenly leave it out, the way I think Rik's patch did.

Anyway, I'm still groggy from allt he flu medication, so take everything I 
say with a grain of salt.

In fact, the more I look at this, the less I think I like Rik's patch in 
the first place. I think the real bug that Rik tried to fix is that 
apparently anon_vma_merge() doesn't necessarily merge everything right. 
>From Rik's bug-explanation, step 5:

>> 5) vma_adjust calls anon_vma_merge, causing the anon_vma
>>    chain of one of the VMAs to get nuked - with bad luck,
>>    this is the original one, leaving just the new anon_vma
>>   attached to the VMA

and I think that _this_ is the real bug to begin with. The real fix should 
be in vma_adjust/anon_vma_merge, not in how we set up the anon_vma in the 
first place. I do _not_ think we should require that we always merged 
things at mmap() time, because we may _never_ be able to merge perfectly 
(ie start out with to disjoing mmaps, and fill in the middle).

			Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ