Message ID | 20231207193319.4025462-1-Liam.Howlett@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5017843vqy; Thu, 7 Dec 2023 11:34:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtr39Epezv8bcc/EfBE+JCNRMzfdhopZdd96z1uYK4MlvpDafq7GZIyVqyAQE+28T6kqT2 X-Received: by 2002:a05:6a20:8628:b0:18c:9856:8ce with SMTP id l40-20020a056a20862800b0018c985608cemr2316739pze.6.1701977642526; Thu, 07 Dec 2023 11:34:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701977642; cv=pass; d=google.com; s=arc-20160816; b=c2yI0MrVf8UIkbNd3OkgQQzn7xOas0VQf46DMP8iT4bJ/f8Km7YTx1kwz+7IglAaZ4 vdXNNgQDuX4SIqJ3iNpxiwxbzdzUeIp25OUc/4PLICOg2PFHk3qC5CVt/MrxjEt3YsNJ jTBAVxiW3N3B5wvavy2YqftM8UVGmz3gcdgBTddukinFS/2vCkKHZ8xd6t1sglgwFz/C T4DK3IHJqbxKQBb9bDUDpUY81zLnQ+eS9I5EiHdZvhekzZ8Y/vC76Z1EYYhGtQsNGFct +ZXvFQL5A7PnAEbQwetb2BJktto7FV4EzIXX0y7cV3rDxN5O8YFlobaEJqJ7NGqQHNUU VxGw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=Y/yPB+ZuNveL3sslVVsAPHGJMVwWyWgfjUVsx1MBY5s=; fh=y13d4aBX2qEjIGDgQLuLfNl4bI2Y1olZ1e1P/XtJIjQ=; b=O7ztnG94JbsmZmU4iv7elCA5MIM+XiUDzFMTji3DGZn9uCuk40ztG7357Xjxt8EmEI mOljYrKHPoe/fVOHVf7zaE2o4zpGD1CxZRbnIfeIPklbyimj8J/gPDQ0aM2UekCSPWdx pwv73DYtWUsk3RFsKWBnjMlKggEvq8kqDvuM7/ty9s20TBAZskJ4msPWebi8XpIfuC60 pbPxj2jZAHEI3bidUCQGVABLDyMMt7hs9DwiF0fCFk9/usOz2ILsDpfnJFRrGf7zOKVz iZ31HIMnqZI0eZbo+ub4QzryE3PgUG4u6UoUpqX9RNyHfMwQ1Xyn4oAU0mCwsW1GK3g1 1IQA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=S2P8TqDY; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wfZ6+z7x; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s1-20020a056a0008c100b006c6930e7540si199809pfu.121.2023.12.07.11.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 11:34:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=S2P8TqDY; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wfZ6+z7x; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 412B48022848; Thu, 7 Dec 2023 11:33:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443805AbjLGTdr (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Thu, 7 Dec 2023 14:33:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443666AbjLGTdq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 7 Dec 2023 14:33:46 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B92C11D; Thu, 7 Dec 2023 11:33:52 -0800 (PST) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3B7JQnnF021849; Thu, 7 Dec 2023 19:33:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=Y/yPB+ZuNveL3sslVVsAPHGJMVwWyWgfjUVsx1MBY5s=; b=S2P8TqDYuRjDyqAhg+Bbp4La35z7Gfu43+5sKwfNBhm3HG8RIcBcylyRrlpYPRF+qoT7 Kzsu2pQZNOoatK6nn1w9n0hsGv1JaGnjHq1cu0v+65TlVXhx74AJSn8NtQqOR9PdYV9O 7VPm+5S0MRacQhPWHFmEBV+rq72w6ddKbAVXuo0LcPsup8aX4Nsq1ync+M8+kAnCyZY1 9c3xMcWJHu7FtHhTOz290QkvUszuRVtxZyeQk6FYEgDqteSI5m84dPFJt/zxgjWFK7kN nvfhEpPMz4Ra0py8IIawPgL1SdnoPEEbZq/DsngNNxraLL+gDgDa2H+M8wxhL/biWOxH kw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3utd1gcv56-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Dec 2023 19:33:31 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3B7IqdQK037847; Thu, 7 Dec 2023 19:33:30 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3utandxwne-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Dec 2023 19:33:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EffPJgxLDHjQ7CI9Bj0yHip/jMd7IuKVboFIxASHiTQlerOvALZjQ8UWiJXk4rXyHWQnR97VyclWmB/ZkcBwo+El1dCemtJ+OkCELUsPOx8AniVegyLX7hSLMImJLr1T7lZE1Qr+JldDIiXYzIweWTnG3NjGsP28/bTOsfSg+3TfuD9GsmBJBdE7dPTTfZyUFYsts1I4sRG9pZLw5mojaSxPfRNRBFD9XiPVg8GG7xmTEqqcZzi8FJazgYXeD8/RRd/GG49XPZIFJgracHXy7/REUHr7AqwvPpCAVCkn6xt+2cI/pjNjz8RZQBItaL7fVnCoEDqJtwLHIY3QCcD9yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y/yPB+ZuNveL3sslVVsAPHGJMVwWyWgfjUVsx1MBY5s=; b=C/yK8NqnCSbIetKzXaXUahbA/bCATcGa1YEeM3M1SoMiq+RxobrsEzOrPOPtIV1M1K+9gEGbRhSWYfV/peLU93QK9i/JklVL0fen3F9lRqq3GK5kn/EijtHNPOkLy6PUxK+Xa33uvud4/l0tnNmyT75YbMyGSKn4DTGdzQR2gNg845QO/A2S5gZSft/yFsl5tcMp856NpvH3ln48Uj6PrFWLv0bJ3rEgzVV+VjWO7RePnX8noCbAIZwXfRJs31SgHRu7XE9295qclMnaI6Mf8eIg7azrg+w034FZYd6vTHtwLUmI4+vJtaWHCa7rex4gj36HUsMfb350V3nr2mY4Iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y/yPB+ZuNveL3sslVVsAPHGJMVwWyWgfjUVsx1MBY5s=; b=wfZ6+z7x2eS9h3iTJobBhikhOrdcNpeOTRqbBXfwdEOfmX8a9INm92eGgwa7nZkUXuyWIUpS5akgCCUtU4JXBB/q+TvrMPW8MtT+EathUOfMz4zPydHFirNbQ5E31O2/y3zr771+9Um9UKGkN3Mx11fNpXBRFEeSgaOBiOPAeuY= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by IA0PR10MB6697.namprd10.prod.outlook.com (2603:10b6:208:443::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.27; Thu, 7 Dec 2023 19:33:23 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::a5de:b1cb:9ae1:d0cc]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::a5de:b1cb:9ae1:d0cc%7]) with mapi id 15.20.7068.027; Thu, 7 Dec 2023 19:33:23 +0000 From: "Liam R. Howlett" <Liam.Howlett@oracle.com> To: Andrew Morton <akpm@linux-foundation.org>, Kees Cook <keescook@chromium.org> Cc: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>, Naresh Kamboju <naresh.kamboju@linaro.org>, linux-kselftest@vger.kernel.org, Linux ARM <linux-arm-kernel@lists.infradead.org>, kft-triage@lists.linaro.org, regressions@lists.linux.dev, Will Deacon <will@kernel.org>, Catalin Marinas <catalin.marinas@arm.com>, Dan Carpenter <dan.carpenter@linaro.org>, Eric Biederman <ebiederm@xmission.com>, linux-next@vger.kernel.org, "Liam R. Howlett" <Liam.Howlett@oracle.com> Subject: [PATCH] maple_tree: Fix mas_prev() state separation code Date: Thu, 7 Dec 2023 14:33:19 -0500 Message-Id: <20231207193319.4025462-1-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231207014104.n6vul2ylgqjnsfia@revolve> References: <20231207014104.n6vul2ylgqjnsfia@revolve> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT4PR01CA0266.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:109::14) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|IA0PR10MB6697:EE_ X-MS-Office365-Filtering-Correlation-Id: 854afb06-58c7-437d-4031-08dbf75b604b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Fm5VboOZDDhN5VGxcwC6TJ7F1ejNlZ80UTNh305+rGnrYA1EpvNBiFshOq/hlDp8dFKjPgQam9Dd4MqWOPIy9W9mbV93zepDw0vrGb45UeM590HSqYw3h9ucH1HqPaBqk7V2Evz3g6amw+bbClGn3P4KM8fA6+/R/tB9BzoaV6XLH8McZqSjqhrqCNF/tct4Xi4WfCxrPgQcVJMRq/ZnHc6hffX8PV+VVXC3xBA1XfFAW/PLBAgEwnE03RO8QK8FktJdD4FhIvXM7VZ6YlruGW8BxJUAvbUyMjf/ha/FJBXVkmvLjly/+cWLvx32Eg+l1Z/e663756bzP7Ro7kcZ8t8uNmpPm7NyFzX0fhDWAa3256YlvBmkyVM2trNyUkACw6qiPM8lF5t8gPdsDoBq+9VmfBvBUY1smAnunpStMm2l0vSrXH9omaLNB+aBVAGzHcdpAgoytDZqcq27c5VT8LSbq9HApswD1fgjFgZKVeKUoOufgJzSnwXv/+sw0tEa8nJheJCQLYJBKssEbeB2ty99103mJVdUmjZauHLLzaSkFj9iEksQmSDszZ/4rCKa X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR10MB3022.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(366004)(39860400002)(376002)(346002)(396003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(6666004)(6506007)(478600001)(38100700002)(6512007)(26005)(107886003)(1076003)(83380400001)(2616005)(5660300002)(8936002)(2906002)(7416002)(8676002)(86362001)(41300700001)(4326008)(36756003)(66946007)(66476007)(54906003)(110136005)(66556008)(316002)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: idHjZXX+j7RlXoWIiePrzDO100TTmkSgjN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z9Y3Xw57fmnbmbc4ZpT1swN+X9VYBHJji9LNu+BhZ2/Oj9xqZsPKCH2Ke6K7s0mJ6e+I3uB3hIH7DjiSAHQ6L5TAWH8IsC9yj6EYrx15MfHnG3qEChwCSBqglBNzmRseUKwBBzq3p4P38tVjDb8baPQo8DOap/kc8RTpVmyei3FN00o+tOFZGaJvc4h6YSCpHLc06OE3tfUSiKEjXgr0TGgwb+RzTrNHMeL/MjCadBn3eo2CU1FrIlqgcfmepiWM3YDW+8qMwUTp7CwbS1H/GRzEA69ID4/EBQjbAmuX7Y2lb6U7mK01r4mlTYuvwahTMKREGhqMYAvdU6oxONCIdyHUvyN43wyPB/6v2wZBhzwUlPKUVTd7QnAWef9Z3kgKlhMuVXgTUCp6Oi7+YdQneJoRpvG3ugqDFgW1CvRfyQo+OZ58CwEzyNC5+izy6wwdypUnEHO12mIWI1D5j8FARnmbG1AlPJuE5DD09V3mVRz5yTeFv5C2ESYl+iv8AagL6oln8EMzKHim98KXg2hqNBMsZ+udBuCrUekmXPR2dHVJbClVNKayd+fqXGQj6SXArFgHLiqBzGtwp21HiqcmeuaOFGKvi121X0rcpPTYs7wxYRI7F8iVvPgLYStRrSjb X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 854afb06-58c7-437d-4031-08dbf75b604b X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2023 19:33:23.4995 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZpT93aYK7hfs+DO3ZmoB6x73va7eMerCDX1uK3bMJmXEx5XSLXXSxs2nSInJIyajpUh2wmYfFvY5Z5hdVin90w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB6697 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-07_17,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2312070164 X-Proofpoint-ORIG-GUID: 8vT8cIXKKXFAi1jeMNw99CR09tZL2c6O X-Proofpoint-GUID: 8vT8cIXKKXFAi1jeMNw99CR09tZL2c6O 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 groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Thu, 07 Dec 2023 11:33:56 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784652908970011811 X-GMAIL-MSGID: 1784652908970011811 |
Series |
maple_tree: Fix mas_prev() state separation code
|
|
Commit Message
Liam R. Howlett
Dec. 7, 2023, 7:33 p.m. UTC
mas_prev() was setting the ma_underflow condition when the limit was
reached and not when the limit was attempting to go lower. This
resulted in the incorrect behaviour on subsequent actions.
This commit fixes the status setting to only set ma_underflow when the
lower limit is attempted to be decremented, and modifies the testing to
ensure that's the case.
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
---
Andrew,
This should be clean to squash into 7f79fdb1d94d7 ("maple_tree: separate
ma_state node from status.") which is currently in your mm-unstable
branch.
Thanks,
Liam
lib/maple_tree.c | 16 ++++++++++++----
lib/test_maple_tree.c | 9 +++++++--
2 files changed, 19 insertions(+), 6 deletions(-)
Comments
On Thu, Dec 07, 2023 at 02:33:19PM -0500, Liam R. Howlett wrote: > mas_prev() was setting the ma_underflow condition when the limit was > reached and not when the limit was attempting to go lower. This > resulted in the incorrect behaviour on subsequent actions. > > This commit fixes the status setting to only set ma_underflow when the > lower limit is attempted to be decremented, and modifies the testing to > ensure that's the case. > > Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> Is this is related to the report[1] I forwarded? If so, please add these tags too: Reported-by: Linux Kernel Functional Testing <lkft@linaro.org> Closes: https://lore.kernel.org/all/CA+G9fYs-j2FYZSFSVZj48mgoM9gQd4-7M2mu2Ez3D1DqDdW2bQ@mail.gmail.com/ [1] Thanks either way! -Kees > --- > > Andrew, > > This should be clean to squash into 7f79fdb1d94d7 ("maple_tree: separate > ma_state node from status.") which is currently in your mm-unstable > branch. > > Thanks, > Liam > > > lib/maple_tree.c | 16 ++++++++++++---- > lib/test_maple_tree.c | 9 +++++++-- > 2 files changed, 19 insertions(+), 6 deletions(-) > > diff --git a/lib/maple_tree.c b/lib/maple_tree.c > index 89f8d21602774..47f2a7a973852 100644 > --- a/lib/maple_tree.c > +++ b/lib/maple_tree.c > @@ -4432,6 +4432,9 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty) > mas->last = mas->index - 1; > mas->index = mas_safe_min(mas, pivots, mas->offset); > } else { > + if (mas->index <= min) > + goto underflow; > + > if (mas_prev_node(mas, min)) { > mas_rewalk(mas, save_point); > goto retry; > @@ -4452,15 +4455,15 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty) > if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) > goto retry; > > - if (mas->index <= min) > - mas->status = ma_underflow; > > if (likely(entry)) > return entry; > > if (!empty) { > - if (mas_is_underflow(mas)) > + if (mas->index <= min) { > + mas->status = ma_underflow; > return NULL; > + } > > goto again; > } > @@ -4596,7 +4599,7 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty) > if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) > goto retry; > > - if (pivot >= max) { > + if (pivot >= max) { /* Was at the limit, next will extend beyond */ > mas->status = ma_overflow; > return NULL; > } > @@ -4611,6 +4614,11 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty) > else > mas->last = mas->max; > } else { > + if (mas->last >= max) { > + mas->status = ma_overflow; > + return NULL; > + } > + > if (mas_next_node(mas, node, max)) { > mas_rewalk(mas, save_point); > goto retry; > diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c > index 15fbeb788f3ac..29185ac5c727f 100644 > --- a/lib/test_maple_tree.c > +++ b/lib/test_maple_tree.c > @@ -3294,8 +3294,8 @@ static noinline void __init check_state_handling(struct maple_tree *mt) > MT_BUG_ON(mt, mas.last != 0x1500); > MT_BUG_ON(mt, !mas_is_active(&mas)); > > - /* next:active ->active */ > - entry = mas_next(&mas, ULONG_MAX); > + /* next:active ->active (spanning limit) */ > + entry = mas_next(&mas, 0x2100); > MT_BUG_ON(mt, entry != ptr2); > MT_BUG_ON(mt, mas.index != 0x2000); > MT_BUG_ON(mt, mas.last != 0x2500); > @@ -3360,6 +3360,11 @@ static noinline void __init check_state_handling(struct maple_tree *mt) > MT_BUG_ON(mt, entry != ptr); > MT_BUG_ON(mt, mas.index != 0x1000); > MT_BUG_ON(mt, mas.last != 0x1500); > + MT_BUG_ON(mt, !mas_is_active(&mas)); /* spanning limit */ > + entry = mas_prev(&mas, 0x1200); /* underflow */ > + MT_BUG_ON(mt, entry != NULL); > + MT_BUG_ON(mt, mas.index != 0x1000); > + MT_BUG_ON(mt, mas.last != 0x1500); > MT_BUG_ON(mt, !mas_is_underflow(&mas)); > > /* prev:underflow -> underflow (lower limit) spanning end range */ > -- > 2.40.1 >
* Kees Cook <keescook@chromium.org> [231207 16:04]: > On Thu, Dec 07, 2023 at 02:33:19PM -0500, Liam R. Howlett wrote: > > mas_prev() was setting the ma_underflow condition when the limit was > > reached and not when the limit was attempting to go lower. This > > resulted in the incorrect behaviour on subsequent actions. > > > > This commit fixes the status setting to only set ma_underflow when the > > lower limit is attempted to be decremented, and modifies the testing to > > ensure that's the case. > > > > Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> > > Is this is related to the report[1] I forwarded? If so, please add these tags > too: > > Reported-by: Linux Kernel Functional Testing <lkft@linaro.org> > Closes: https://lore.kernel.org/all/CA+G9fYs-j2FYZSFSVZj48mgoM9gQd4-7M2mu2Ez3D1DqDdW2bQ@mail.gmail.com/ [1] > Ah, yes it is. I missed these tags. Sorry about that. I have another patch to send in regards to this area on the mmap_region() side but it's less urgent. I'll Cc you on that one as well. > Thanks either way! > > -Kees > > > --- > > > > Andrew, > > > > This should be clean to squash into 7f79fdb1d94d7 ("maple_tree: separate > > ma_state node from status.") which is currently in your mm-unstable > > branch. > > > > Thanks, > > Liam > > > > > > lib/maple_tree.c | 16 ++++++++++++---- > > lib/test_maple_tree.c | 9 +++++++-- > > 2 files changed, 19 insertions(+), 6 deletions(-) > > > > diff --git a/lib/maple_tree.c b/lib/maple_tree.c > > index 89f8d21602774..47f2a7a973852 100644 > > --- a/lib/maple_tree.c > > +++ b/lib/maple_tree.c > > @@ -4432,6 +4432,9 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty) > > mas->last = mas->index - 1; > > mas->index = mas_safe_min(mas, pivots, mas->offset); > > } else { > > + if (mas->index <= min) > > + goto underflow; > > + > > if (mas_prev_node(mas, min)) { > > mas_rewalk(mas, save_point); > > goto retry; > > @@ -4452,15 +4455,15 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty) > > if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) > > goto retry; > > > > - if (mas->index <= min) > > - mas->status = ma_underflow; > > > > if (likely(entry)) > > return entry; > > > > if (!empty) { > > - if (mas_is_underflow(mas)) > > + if (mas->index <= min) { > > + mas->status = ma_underflow; > > return NULL; > > + } > > > > goto again; > > } > > @@ -4596,7 +4599,7 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty) > > if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) > > goto retry; > > > > - if (pivot >= max) { > > + if (pivot >= max) { /* Was at the limit, next will extend beyond */ > > mas->status = ma_overflow; > > return NULL; > > } > > @@ -4611,6 +4614,11 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty) > > else > > mas->last = mas->max; > > } else { > > + if (mas->last >= max) { > > + mas->status = ma_overflow; > > + return NULL; > > + } > > + > > if (mas_next_node(mas, node, max)) { > > mas_rewalk(mas, save_point); > > goto retry; > > diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c > > index 15fbeb788f3ac..29185ac5c727f 100644 > > --- a/lib/test_maple_tree.c > > +++ b/lib/test_maple_tree.c > > @@ -3294,8 +3294,8 @@ static noinline void __init check_state_handling(struct maple_tree *mt) > > MT_BUG_ON(mt, mas.last != 0x1500); > > MT_BUG_ON(mt, !mas_is_active(&mas)); > > > > - /* next:active ->active */ > > - entry = mas_next(&mas, ULONG_MAX); > > + /* next:active ->active (spanning limit) */ > > + entry = mas_next(&mas, 0x2100); > > MT_BUG_ON(mt, entry != ptr2); > > MT_BUG_ON(mt, mas.index != 0x2000); > > MT_BUG_ON(mt, mas.last != 0x2500); > > @@ -3360,6 +3360,11 @@ static noinline void __init check_state_handling(struct maple_tree *mt) > > MT_BUG_ON(mt, entry != ptr); > > MT_BUG_ON(mt, mas.index != 0x1000); > > MT_BUG_ON(mt, mas.last != 0x1500); > > + MT_BUG_ON(mt, !mas_is_active(&mas)); /* spanning limit */ > > + entry = mas_prev(&mas, 0x1200); /* underflow */ > > + MT_BUG_ON(mt, entry != NULL); > > + MT_BUG_ON(mt, mas.index != 0x1000); > > + MT_BUG_ON(mt, mas.last != 0x1500); > > MT_BUG_ON(mt, !mas_is_underflow(&mas)); > > > > /* prev:underflow -> underflow (lower limit) spanning end range */ > > -- > > 2.40.1 > > > > -- > Kees Cook
diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 89f8d21602774..47f2a7a973852 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -4432,6 +4432,9 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty) mas->last = mas->index - 1; mas->index = mas_safe_min(mas, pivots, mas->offset); } else { + if (mas->index <= min) + goto underflow; + if (mas_prev_node(mas, min)) { mas_rewalk(mas, save_point); goto retry; @@ -4452,15 +4455,15 @@ static void *mas_prev_slot(struct ma_state *mas, unsigned long min, bool empty) if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) goto retry; - if (mas->index <= min) - mas->status = ma_underflow; if (likely(entry)) return entry; if (!empty) { - if (mas_is_underflow(mas)) + if (mas->index <= min) { + mas->status = ma_underflow; return NULL; + } goto again; } @@ -4596,7 +4599,7 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty) if (unlikely(mas_rewalk_if_dead(mas, node, save_point))) goto retry; - if (pivot >= max) { + if (pivot >= max) { /* Was at the limit, next will extend beyond */ mas->status = ma_overflow; return NULL; } @@ -4611,6 +4614,11 @@ static void *mas_next_slot(struct ma_state *mas, unsigned long max, bool empty) else mas->last = mas->max; } else { + if (mas->last >= max) { + mas->status = ma_overflow; + return NULL; + } + if (mas_next_node(mas, node, max)) { mas_rewalk(mas, save_point); goto retry; diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 15fbeb788f3ac..29185ac5c727f 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -3294,8 +3294,8 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, mas.last != 0x1500); MT_BUG_ON(mt, !mas_is_active(&mas)); - /* next:active ->active */ - entry = mas_next(&mas, ULONG_MAX); + /* next:active ->active (spanning limit) */ + entry = mas_next(&mas, 0x2100); MT_BUG_ON(mt, entry != ptr2); MT_BUG_ON(mt, mas.index != 0x2000); MT_BUG_ON(mt, mas.last != 0x2500); @@ -3360,6 +3360,11 @@ static noinline void __init check_state_handling(struct maple_tree *mt) MT_BUG_ON(mt, entry != ptr); MT_BUG_ON(mt, mas.index != 0x1000); MT_BUG_ON(mt, mas.last != 0x1500); + MT_BUG_ON(mt, !mas_is_active(&mas)); /* spanning limit */ + entry = mas_prev(&mas, 0x1200); /* underflow */ + MT_BUG_ON(mt, entry != NULL); + MT_BUG_ON(mt, mas.index != 0x1000); + MT_BUG_ON(mt, mas.last != 0x1500); MT_BUG_ON(mt, !mas_is_underflow(&mas)); /* prev:underflow -> underflow (lower limit) spanning end range */