From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932083AbbGAPr6 (ORCPT ); Wed, 1 Jul 2015 11:47:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43484 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754535AbbGAPrr (ORCPT ); Wed, 1 Jul 2015 11:47:47 -0400 Date: Wed, 1 Jul 2015 17:46:23 +0200 From: Oleg Nesterov To: David Rientjes Cc: Andrew Morton , Al Viro , Benjamin LaHaise , Hugh Dickins , Jeff Moyer , Kirill Shutemov , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] mremap: don't leak new_vma if f_op->mremap() fails Message-ID: <20150701154623.GA14934@redhat.com> References: <20150619231913.GA25877@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/30, David Rientjes wrote: > > On Sat, 20 Jun 2015, Oleg Nesterov wrote: > > > move_vma() can't just return if f_op->mremap() fails, we should > > unmap the new vma like we do if move_page_tables() fails. To avoid > > the code duplication this patch moves the "move entries back" under > > the new "if (err)" branch. > > > > Signed-off-by: Oleg Nesterov > > Looks good! I think it was sniped by commit 4abad2ca4a4d ("mm: new > arch_remap() hook") No, it was b2edffdd912b "fix mremap() vs. ioctx_kill() race" > so it needs to be rebased, Yes, thanks, I'll rebase... But you know, I think 4abad2ca4a4d ("mm: new arch_remap() hook") should be reverted later. Please see [PATCH v2 1/1] mm: move ->mremap() from file_operations to vm_operations_struct http://marc.info/?l=linux-kernel&m=143526519407521 I think arch_remap() should be turned into special_mapping_vmops->nremap(). But this is off-topic right now. > but after that feel free to add my > Acked-by: David Rientjes Thanks! Oleg.