Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2533893rdb; Fri, 22 Sep 2023 01:04:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1n2KA+2WRSkIyHnN06t2Cuh2kZ45nl3lGHyIEHEKpedrf3cb1IqPZwfTZ+3SU2sL48ZwC X-Received: by 2002:a05:6358:9913:b0:143:3845:e6fb with SMTP id w19-20020a056358991300b001433845e6fbmr9728533rwa.27.1695369878920; Fri, 22 Sep 2023 01:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695369878; cv=none; d=google.com; s=arc-20160816; b=rrLSVHJzSsoUFjPtM3TL54xhHsS+pYgTCOikiXeFEeQWUxHuYVuwTfsRgKX3EA71Ab DSnBXyfR9PUUM97J0XOzOcUESb6jDV39MVoS8wsCwNuSBD3oQ0XzBZ5XdNfASIRDEcSE d4k3TVTZD+Kog5RAtAcjR7IDBXMjNJQdBvaxQA4CNLf5v716MFv+uHPHWm+X67x9hyhZ ldhFXZYe/Li2jnn694VRGoyNAUwKILrOjPGRjxYoX4kJRFIh7uEYNKKHiOXMTbV28HWL 97ujNUUkn7LpyjqFgQE3cFwvT2XGyMaxXWD9O2mi31S3Gwwnn6bHdChhrgMAEmNDucAD JpRQ== 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:to:from:date:dkim-signature; bh=6MZo+bKI+dkoYi+eqghinL9pk/+RSKBqGz2KYE0utpQ=; fh=+KErxmgSP8LnrsckGGiJ9qe0EyyK4Ue9t++Pr10x6HQ=; b=dr0+kQTrAP/Cz6wEVeOdo+XK9RoMQ+jhyttrbebXT28zze8Jsvf5pgI3pkqC4cyh7c hiRv0z07n3FBuMQ1scAumgbLUNFaZWWfoAhWlomE7f5zgV1Bo6SVOOiWjMYvj53KnIyv PKUgXK5MYCqXHwaphYqIXkE7QgzffOSNi7Sa93Mfoc14qNtumss0YoFiUq8ID8vPzhN8 HDWT9mLX2CDuZo/hl4Vdz/wN2BxJ7lwDebuY+Srmes+VQY+FYGt3NQ3BbYmemfXj4uJb 2Fw89si+DZrAFCPrlEzkGdhBCSWdV1nPNfK+wMEuEzDtf+e0xK+DB1T3KVlktUjY2krz vGkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vOUlNLA6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cf4-20020a056a02084400b0055e48c43ab7si3321537pgb.470.2023.09.22.01.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 01:04:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vOUlNLA6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 5D55381E021E; Thu, 21 Sep 2023 12:23:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229514AbjIUTX2 (ORCPT + 99 others); Thu, 21 Sep 2023 15:23:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjIUTX1 (ORCPT ); Thu, 21 Sep 2023 15:23:27 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E846EBFDA for ; Thu, 21 Sep 2023 12:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6MZo+bKI+dkoYi+eqghinL9pk/+RSKBqGz2KYE0utpQ=; b=vOUlNLA6gi6a77sf2a0EMWckIP U9SHkHm+2Ygh0/Ah0iOCqkXL+Q9MJnpMzwujpsaaKzddIpbufoI1ZZjuhzYy8CTSQHV0JtHP+QHE2 Mjc1JreF0no05YKJsaedmmM2QTiWRz8NhUT15qBdDM+pC1obKAsgedMG/pqOfSXy8T82YpIRjLMqH dJWgKiuOLGD+C/CDbuwhanZu+MQV5DrIjRkc4DMVn3eno1+INzdcABA6w1JXHckVzOt+eg0xbmIaX dg/sSNwrRLkURkrtHhhUdt0FDUWmbZfCBBvT9ayCs6GGdCKJLV55RVSuO2tTIptgusgWxCajx3tgl +UPxL0Kw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qjPGZ-00DgWf-2C; Thu, 21 Sep 2023 19:23:11 +0000 Date: Thu, 21 Sep 2023 20:23:11 +0100 From: Matthew Wilcox To: "Liam R. Howlett" , Andrew Morton , maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pedro.falcato@gmail.com, stable Subject: Re: [PATCH 0/2] maple_tree: Fix mas_prev() state regression. Message-ID: References: <20230921181236.509072-1-Liam.Howlett@oracle.com> <20230921112521.fc07c658804f4e188179da77@linux-foundation.org> <20230921185330.j5jw3oms4tc6crkf@revolver> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230921185330.j5jw3oms4tc6crkf@revolver> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 12:23:34 -0700 (PDT) On Thu, Sep 21, 2023 at 02:53:30PM -0400, Liam R. Howlett wrote: > * Andrew Morton [230921 14:25]: > > On Thu, 21 Sep 2023 14:12:34 -0400 "Liam R. Howlett" wrote: > > > > > Pedro Falcato contacted me on IRC with an mprotect regression which was > > > bisected back to the iterator changes for maple tree. Root cause > > > analysis showed the mas_prev() running off the end of the VMA space > > > (previous from 0) followed by mas_find(), would skip the first value. > > > > > > This patch set introduces maple state underflow/overflow so the sequence > > > of calls on the maple state will return what the user expects. > > > > It isn't clear what are the user-visible effects of this flaw? Please > > send this along and I'll paste it in. > > > User may notice that mas_prev() or mas_next() calls that result in going > outside of the limit passed to the call will cause incorrect returns on > subsequent calls using that maple state, such as mas_find() skipping an > entry. When Andrew says "User visible" he means "userspace visible". Not "in kernel user visible". What are the _consequences_. I'd say that if the user maps something at address 0, mprotect() can then fail to ... or something.