From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84AB4C28CBC for ; Thu, 7 May 2020 00:56:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3E94220708 for ; Thu, 7 May 2020 00:56:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="XdK+ZklR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E94220708 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=joelfernandes.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C7E1990002B; Wed, 6 May 2020 20:56:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2DFE900023; Wed, 6 May 2020 20:56:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B43BD90002B; Wed, 6 May 2020 20:56:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id 9CCDF900023 for ; Wed, 6 May 2020 20:56:08 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 57811824559C for ; Thu, 7 May 2020 00:56:08 +0000 (UTC) X-FDA: 76788106416.04.veil36_8cde0e65ad363 X-HE-Tag: veil36_8cde0e65ad363 X-Filterd-Recvd-Size: 5641 Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 May 2020 00:56:07 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id w4so4295694ioc.6 for ; Wed, 06 May 2020 17:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uTZI/F41ZnJFrUE+FVQ0Jc0NsPmmFnVbnHSoplh9O30=; b=XdK+ZklREmT8RhLEEu0G6URSmzXx9v8mRFMStVvR9AnyZA+y/65G8eUd16BCnxCElq agRhJuRnP4dfKugRBjiiqqh8GTv9Hr1hkmubVwk/bqxq2OxImiPGA5K+45iv1/kLtm4L PlQh8IBBTlKCRKNHAFeml4o4CiGJYAB86oucI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uTZI/F41ZnJFrUE+FVQ0Jc0NsPmmFnVbnHSoplh9O30=; b=gcnWJTG0XOviboDConssRer/3himJBLhF1aqTyp+yTloEuL4ce3HWDv13j+Y+Nv+YW npDlT8ZruLdjYALgBOiDXF6rKX1oTgqrcj7Phdjj4FNV1D3rQYsaFOQK0It/2656lYMu cnQeWk74UCAtrVkSL1tCd4rWUPEkwBZGS256SkfVgZbW4hrC5kFt9wg5/7edWFNMxBfQ BZgeW4YAbJtp/pD9z5O9t816mxIXMU1DNTW6aj9ow7Y6uz4N4dKtlOeHAaY1cpVD/i8b l0nwLveaqC3ZrgIbXQo4n4ORPIfk9ODMBD0tPIbUbHgVOeE2KbNKH4mUQAoowFh2Worb 4zUw== X-Gm-Message-State: AGi0Puay7wQGwTXv2CG6m4vlsyEaHw55MY/EQamZNHus+9PnPs9+3DxR ZY20q/L4eImB0UpNkZPA7+66khWMHHJP5IKyJR0tHQ== X-Google-Smtp-Source: APiQypK7tW3MfW0FGcrXaMeS/bmC/PyGWc0vtFD5prm2IEa/O6Nv5e6InE5cxBEN7bvCrIzsH5jyGLFDfiDh1UET0RQ= X-Received: by 2002:a5d:8c89:: with SMTP id g9mr11161027ion.1.1588812967176; Wed, 06 May 2020 17:56:07 -0700 (PDT) MIME-Version: 1.0 References: <20200506172158.218366-1-bgeffon@google.com> In-Reply-To: From: Joel Fernandes Date: Wed, 6 May 2020 20:55:55 -0400 Message-ID: Subject: Re: [PATCH] userfaultfd: fix remap event with MREMAP_DONTUNMAP. To: Brian Geffon Cc: Andrew Morton , "Michael S . Tsirkin" , LKML , linux-mm , Andrea Arcangeli , Sonny Rao , Minchan Kim , "Kirill A . Shutemov" Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Brian, On Wed, May 6, 2020 at 1:32 PM Brian Geffon wrote: > > It hasn't landed in a stable kernel yet, 5.7 is rc4 so I don't think > it needs to cc stable, right? I think the criteria is, if it has been merged into Linus's tree in a kernel release, then CC'ing stable means any future stable releases of the kernel will have the patch applied to the stable tree. The fix patch itself will need to be merged into Linus tree at a future date before being applied to the stable tree. But at least CC'ing stable means it is tracked my stable bots and they'll do the right. This is my understanding. If the patch you are fixing was applied for v5.7 merge window, then I don't think you need to CC stable. > Andrew, I'd be happy to mail a new patch if necessary, otherwise here > is the fixes: > > Fixes: e346b38 ("mm/mremap: add MREMAP_DONTUNMAP to mremap()") I'd also avoid top-posting and send inline replies: https://web.archive.org/web/20080722025748/http://www.zip.com.au/~akpm/linux/patches/stuff/top-posting.txt https://lkml.org/lkml/2019/12/4/267 Thanks! - Joel > > Brian > > > On Wed, May 6, 2020 at 10:28 AM Joel Fernandes wrote: > > > > On Wed, May 6, 2020 at 1:22 PM Brian Geffon wrote: > > > > > > A user is not required to set a new address when using > > > MREMAP_DONTUNMAP as it can be used without MREMAP_FIXED. > > > When doing so the remap event will use new_addr which may not > > > have been set and we didn't propagate it back other then > > > in the return value of remap_to. > > > > > > Because ret is always the new address it's probably more > > > correct to use it rather than new_addr on the remap_event_complete > > > call, and it resolves this bug. > > > > > > > Does it need Fixes: tag, and CC to stable? Going into a stable kernel > > will mean the stable kernel merges into ChromeOS also gets it. > > > > thanks, > > > > - Joel > > > > > Signed-off-by: Brian Geffon > > > --- > > > mm/mremap.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/mm/mremap.c b/mm/mremap.c > > > index c881abeba0bf..6aa6ea605068 100644 > > > --- a/mm/mremap.c > > > +++ b/mm/mremap.c > > > @@ -794,7 +794,7 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, > > > if (locked && new_len > old_len) > > > mm_populate(new_addr + old_len, new_len - old_len); > > > userfaultfd_unmap_complete(mm, &uf_unmap_early); > > > - mremap_userfaultfd_complete(&uf, addr, new_addr, old_len); > > > + mremap_userfaultfd_complete(&uf, addr, ret, old_len); > > > userfaultfd_unmap_complete(mm, &uf_unmap); > > > return ret; > > > } > > > -- > > > 2.26.2.526.g744177e7f7-goog > > >