From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 1/1] mm: mempolicy: fix mbind_range() && vma_adjust() interaction Date: Tue, 9 Jul 2013 14:56:45 -0700 Message-ID: <20130709145645.bd48e31c1a7d9e83d521b845@linux-foundation.org> References: <1372901537-31033-1-git-send-email-ccross@android.com> <20130704202232.GA19287@redhat.com> <20130708180424.GA6490@redhat.com> <20130708180501.GB6490@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130708180501.GB6490@redhat.com> Sender: owner-linux-mm@kvack.org To: Oleg Nesterov Cc: Colin Cross , Hugh Dickins , Linus Torvalds , "Hampson, Steven T" , lkml , Kyungmin Park , Christoph Hellwig , John Stultz , Rob Landley , Arnd Bergmann , Cyrill Gorcunov , David Rientjes , Davidlohr Bueso , Kees Cook , Al Viro , Mel Gorman , Michel Lespinasse , Rik van Riel , Konstantin Khlebnikov , Peter Zijlstra , Rusty Russell , "Eric W. Biederman" , Srikar Dronamraju , KAMEZA List-Id: linux-arch.vger.kernel.org On Mon, 8 Jul 2013 20:05:01 +0200 Oleg Nesterov wrote: > vma_adjust() does vma_set_policy(vma, vma_policy(next)) and this > is doubly wrong: > > 1. This leaks vma->vm_policy if it is not NULL and not equal to > next->vm_policy. > > This can happen if vma_merge() expands "area", not prev (case 8). > > 2. This sets the wrong policy if vma_merge() joins prev and area, > area is the vma the caller needs to update and it still has the > old policy. > > Revert 1444f92c "mm: merging memory blocks resets mempolicy" which > introduced these problems. > > Change mbind_range() to recheck mpol_equal() after vma_merge() to > fix the problem 1444f92c tried to address. > So I assume the kernel still passes Steven's testcase from the 1444f92c changelog? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org