Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp160206rdh; Wed, 22 Nov 2023 23:25:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtGGW513yn536h8k/MofdupoMA2Ve8EJRhVAeATw8jL7PzDGB11iK2dhlpUStwSGS2mDVR X-Received: by 2002:a05:6a20:1586:b0:18a:d4c3:1350 with SMTP id h6-20020a056a20158600b0018ad4c31350mr4604245pzj.44.1700724345148; Wed, 22 Nov 2023 23:25:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700724345; cv=none; d=google.com; s=arc-20160816; b=aZv37OFSjKznftasAHdPasyBh3BJBjiZvUQFrdDe7oUw/gd9KLQ3KVWEjz+qb6Udg/ OYhz0zeBzbPoh36/r5htZe/2oF0cYmLRTBNFwi3YOEkvhxdRT/NqJbtNWplCMmHGOMBz S5LrYedDr8oHT2TRRgVMovrh226GzLeEAQCdl8SgMWVAo6csKU7v5LGDweir1plgx7TL aEfXNPEslAT3IoDugQWxqz/9QZ/vBD9JGtl/25RrbyE8yHH7D/k3s7wRZKoZ5aa0iNDg HhSvC+0KgRrUZ0iXJIch6ZECC7Hz5Z7ElXnX0fxEVAiep6VoBI5yR05G2gTGCGp8HAGB aylw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ymXPGuek+YUqZ+cTCcWRVVyz0cUPzd9VJqoG6IBQ/u4=; fh=xlRG/ctwqmTme5HrOpixOFf1E0Ug1ecqWpxpTddbOOw=; b=gq2Rgp+fBL0TRnpU7eetesU2LPjFn4gF3+jFg3C5EB68r7iiC0zFF+FcT4eXXG3g6y wmmofFURQqaTFAS6BmqAms8tI07NGe5UlenuXUZtzDeqFKn/k2834gP4EeY/M558wTR5 05X0qtCXMXjiyfQJKZkgXDbrJ44xMZZo/ZukOFCK9DX17G6ANXtG8Hne5mW/SU/pYQo0 n60rx9hubBqE7JBr3/bbufj/jtUrAekbFS5Za9NA/TP5nh368R8Towi7vmSHAcefsUep GVxbjPSsObep5Nhx6rIrCKmLyKGMS2SWsUG6tAAItj1QCIf8E02UcF+j1U7GJZBihVhz 5uOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="tx/ec7Gk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id h23-20020a170902ac9700b001c9e75f87edsi621499plr.152.2023.11.22.23.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 23:25:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="tx/ec7Gk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B40D0808207C; Wed, 22 Nov 2023 23:25:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233871AbjKWHZ2 (ORCPT + 99 others); Thu, 23 Nov 2023 02:25:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231744AbjKWHZY (ORCPT ); Thu, 23 Nov 2023 02:25:24 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E81E8112 for ; Wed, 22 Nov 2023 23:25:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ymXPGuek+YUqZ+cTCcWRVVyz0cUPzd9VJqoG6IBQ/u4=; b=tx/ec7GkHS3eCYwtH2GmMOqqQH vJwfb1p3YMwuJucI9f24yWXTOuXlv16U5ABtNAWfbYM3l9VQ4KNAFXCy55GtyJPRtjpF+pv5T9c+C O6QfeD4T8jkLP1/k0QfO1nQUnMFlbMu1emuchcXz1YZagsxJPYwezcj3w8fXn+ZOEIbo4njJky9ZH w52qMOU9PA3XZDKZlWmT5NLCqpbXvcnm9VhbAtrG2I9GK3K63xxyykPsu8gUQK7ROwjXn1qwsjaRJ VhiKotQ5/IDWnZE5ATkI/Oh8Wto+GgF+H+uXU44f39S9g1ALAzWmxnaGj9cZRaNyo6Z+IdL+HjCUH iOF81E3w==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1r645Y-0041tu-0V; Thu, 23 Nov 2023 07:25:28 +0000 Date: Wed, 22 Nov 2023 23:25:28 -0800 From: Christoph Hellwig To: Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mike Kravetz , "Kirill A . Shutemov" , Lorenzo Stoakes , Axel Rasmussen , Matthew Wilcox , John Hubbard , Mike Rapoport , Hugh Dickins , David Hildenbrand , Andrea Arcangeli , Rik van Riel , James Houghton , Yang Shi , Jason Gunthorpe , Vlastimil Babka , Andrew Morton Subject: Re: [PATCH RFC 05/12] mm/gup: Fix follow_devmap_p[mu]d() to return even if NULL Message-ID: References: <20231116012908.392077-1-peterx@redhat.com> <20231116012908.392077-6-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231116012908.392077-6-peterx@redhat.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 22 Nov 2023 23:25:42 -0800 (PST) On Wed, Nov 15, 2023 at 08:29:01PM -0500, Peter Xu wrote: > This seems to be a bug not by any report but by code observations. > > When GUP sees a devpmd or devpud, it should return whatever value returned > from follow_devmap_p[mu]d(). If page==NULL returned, it means a fault is > probably required. Skipping return the NULL should allow the code to fall > through, which can cause unexpected behavior. > > It was there at least before the follow page rework (080dbb618b) in 2017, > so 6 years. Not yet digging for a Fixes, assuming it can hardly trigger > even if the logical bug does exist. > > Signed-off-by: Peter Xu I'd still add a fixes tag and send if off to Linux for 6.7-rc instead of letting it linger. Otherwise looks good: Reviewed-by: Christoph Hellwig