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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 495A8E7D0A2 for ; Thu, 21 Sep 2023 19:23:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0B536B01F6; Thu, 21 Sep 2023 15:23:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BAF76B0254; Thu, 21 Sep 2023 15:23:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8AA036B0257; Thu, 21 Sep 2023 15:23:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7B48F6B01F6 for ; Thu, 21 Sep 2023 15:23:20 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 46E101408F2 for ; Thu, 21 Sep 2023 19:23:20 +0000 (UTC) X-FDA: 81261578160.26.8E44E27 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf12.hostedemail.com (Postfix) with ESMTP id 615F440005 for ; Thu, 21 Sep 2023 19:23:18 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=vOUlNLA6; dmarc=none; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695324198; a=rsa-sha256; cv=none; b=EGeta2IMkD1Fy9+jtDcVBpXNEqrmz8voUsPgntspDTAMKyRVDh6acCrRLfaj2QvCjEPD79 0ZAfWdn3JLaCGe1EdpqlG1P3r34Izi4IwQWUMhOtPok+S5YvTFiQVnMupYElDqtSllV/Q4 Gr53IuljnDjdnabU/+znzW15VbO0fWo= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=vOUlNLA6; dmarc=none; spf=none (imf12.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695324198; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6MZo+bKI+dkoYi+eqghinL9pk/+RSKBqGz2KYE0utpQ=; b=DZuW6ebsVIltO1W3BIqy4+0cytSkqT3M4ZPieyqqL+tsvLuAdBbvBYvW603En3fqPDR2/C OOubnJPk2xwHgmXIxZ67Pvs42+OSFXf94nRW60Cm6+C4gFs5e1jEhWcKvS3zS8L1bhkj9D uvx8Bz54gI1m2P4gOcNIhoNgGaRFaBo= 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-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 615F440005 X-Stat-Signature: abwyb18dk773rjjn9ermr8icdmkgbf7e X-HE-Tag: 1695324198-730120 X-HE-Meta: U2FsdGVkX18wmSL3tPLuI8kL87cMHhUgPZnLWDs5sNyRChzN0zk3ydwFxkzA//zC8jc4k3f63ce+aZvJ7W74EGPrKqsKKZE0i1maxx8v2aI8jIfK9hVzjHdEkQI7I3L6dY100d7bq9b85C1VvEFQ1Ory1K5+dg5srAhOQxXQYqF0EB0AC6txTV3/x8mPBjZ5xvTXLotxG9sxPMJZV0+I66CcXMRcbxr1tUcf28/k4zM386oPFzwm96Egje2HJtNLSen6e24wS+MHldfWKb7kZi0F8dcFi4BN6Rlvjn2e6JmeHwvFPfsHSnQFD+qYtj6oHAwuiLgMf4gt8GUyhXy+0XdXG/voxfv+e2c3T0LUU71WxQXage8vtGxTTaseWEDCejeVADiwFvPQ3ybz0EzFXxfLVhuM366M7CEtHwOSt8LmM2PsoKlUN7KUhVY2pxQcKUXadpf/2BQsmPUwNbk/7ulMeaEwgZxY99Gab6RS1s7ZA3VK+7ydpdZ5AY7NW9M6BHyL5CnxpHiEp84TJd7ZRR8aZmyd5NP18pg19w1uxkpj7aw7gAhW7rtpo/oCMFfuYYy0lSkoW4gebC0uhMbi62rB7x4CLWuUwhWU/F6oEw0oRS1U8fw8woe+Aq2mKRwgULsaDnI5I55pX7GqFCUtdBD3cCV/jIN1mPnhWJFUfCipTa6Mr91yRJw7hV3KzwQkmWAy8ySS0fvmyQ8eOY9+Ar488uScddqn7F9o/2TgWe5eb/mVgC7+zh+lbLxOIPkw9JSx03VGmRAuwST/2GeGqDb50adJBvFJAMSpf/DdmcNplM3iLfRMsdMiNrk0sMgv00yPYQk70G7Rsb0izWZdySVjjjbWgBxSIpFQ+Qdi/NLTDFpyOemk0BzKzrkOu40uMF64hwy+DaA8y+uhmpVvEQ4VyMeTlbFmhqrAdOXjetAlTzoDdYdHe7foMXww0Qdk6HyBfFdaX4wXsqqts9q 5w3WWwn1 RoT58MEdoBe4o87NJDP1MZME0dXaA+riuisJNJ3cyJIiRotn0OVUn8+WNvqSYUtQlHCZ7HgWEUjSDULOxqrR1jOTwC+t61auxR6MXA34rhexoXDclxzL2OJ9GyaDe1ui50Niix/BRotddhEzajlLJKjSEvw9cREiiqkBrNkWRC/Tdn9yebGwLDgq8mS6Va2Q6DUbt7io67VCzKmzuuRUY1skRBJav9j7EWmRQjVARJIO8Y86o8Avq54uaoVJ1/FowmN6zw0D8KIOghjKdHUZ55F+ELnKmQsABISuLp0rQOTnb611okW7JGs4jkhGrQc0pkYW6u+0ia1Umae4= 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: 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.