Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2502751rdb; Fri, 8 Dec 2023 09:55:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2DBreEVsl2f/dck/CMU5pjeymEZze8QfoyZH2N0UIyqXpwwY7r4i2+ZweXanSrC2UBX2u X-Received: by 2002:a05:6358:f18:b0:170:17eb:9c48 with SMTP id b24-20020a0563580f1800b0017017eb9c48mr278420rwj.41.1702058120709; Fri, 08 Dec 2023 09:55:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702058120; cv=pass; d=google.com; s=arc-20160816; b=IZwE2oH3XwS462Axtp6OE+yLuQUd9s7d0RqNvRr6ryl3wyty5ozpujXgJMfuj2eknA wqM2fmfyfVOouFyH7D6+GFtkJalNhjdYzsdNXwqmTlAUYDd5CsJ+l+kodfT6KNlWmM0Z 1sdexsLTof+DBK3+UoDX60GXBebvQrPtmNku4Kw97AIn2emsudtkLZ0VkyL6lZ/I2pK7 nboiuYZpk3OYF5tZbeOluKW35cm6ssIBC/F8s4wjuJV4405W5sGUsGCKAbC/vywMoKvp YrI0J/el+vBDBro2PCW3vd+HmmIevLmmIyEmAEa0XgoyYKiZQUBpHEFvVYuPHPW7OvQC x1ag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:in-reply-to :content-disposition:references:mail-followup-to:message-id:subject :cc:to:from:date:dkim-signature:dkim-signature; bh=4oa3g8W3PzpoyhK3OXaDaytYbc9UcglW/PBetLTGnB4=; fh=4acrOt2zRXiVFo/jewAae9YSeUfFUyJXSDSVQY5YVmM=; b=lTnE8wtf3r8+dFtElPrI2PIl+VSyOvFlPsp8Fr9l/fwFy45OR1yA/kV4reYOrSRX8Z ztJFNFSj3vxAZf1VSFq5GGJIFwp5m2Xpzpn4w5A2xCdBYGaYyItBk030jvCJbaVZZUnc Y3qYjTUrS7IyigYREdeJvnjPPuL7lKFZy6aRgtrWbPt4/yeQhTrs3oAKKov/iN21uzvo v59QL6j98W0xt4d9Q1woagYZIOsVWwIikwepa7UjMVNk/aipliYJLyh9WF4Az4y1++nz I9AA8+AQQSxFo46ACkKWr+YRWSgXKY9TckUv1qcsy0dXJmEr0cKxEzwJ1LWNGQOPYsAd feSQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b="Vj/6o5vO"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=leKVbBGS; 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 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id z23-20020a656657000000b005c674eb1ca0si1763715pgv.311.2023.12.08.09.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 09:55:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b="Vj/6o5vO"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=leKVbBGS; 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 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 0C5968317551; Fri, 8 Dec 2023 09:55:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1574532AbjLHRye (ORCPT + 99 others); Fri, 8 Dec 2023 12:54:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574556AbjLHRyc (ORCPT ); Fri, 8 Dec 2023 12:54:32 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73FC01738; Fri, 8 Dec 2023 09:54:37 -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 3B8DNrmr015062; Fri, 8 Dec 2023 17:54:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2023-11-20; bh=4oa3g8W3PzpoyhK3OXaDaytYbc9UcglW/PBetLTGnB4=; b=Vj/6o5vOzd3PHcow6aun1jxMgXZHN4tiGrrTL9oWYv7E6H01gt3FhkFovjEE+jCg7STa ypYv14UOtlU3GDkLs7rEJJ8C54eseDwdp8CRLowJzWoVDwypYRHgboebcnZaHaTqp2yj /ScT/0UINdpLsAOrOO78MdHVQALAjqwu9hl+6Qo7iE+FlFvjAawiGVUeUvQANtdPAQNg wKy5BP/QuDIZztJs/IOKdIpo87jc5xZFSiOCTDaoPhBt2238ph6nj+W8id4fISE6b6At a0Ho4rgoF9Ose/V68ZJ7m+tNrw8DxoeLmCWFFSOkCXttoKXFXatrVaYPzSj+hN4dDe7a HA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3utd1ges35-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Dec 2023 17:54:08 +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 3B8HTJlv040287; Fri, 8 Dec 2023 17:54:07 GMT Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3utanf7ga2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Dec 2023 17:54:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=itydpTjbCTx/CEjXUBFCTQ5pa2buIPl/8XUII8yuv+NFGfFWd/wIP19oQnf8QcgwYO0aczyW5F51qi/5LAzRcwrisZQEVNsxklzklunbDWiORXWFnu6fczGK+zr5R76CdMXoBR759n8xlLd1gX0tTQX1dNKchfIW2oT1Rxz9WPsVt8JlVNmWEjJU/mDCSSJSCDfSv77HeB413TgOv+SDrY7yNbglepG33lV1xFGqXnH+VaTM+Qtdn/Gi0MgTkudeKT4el1OZ1dqREW37c1O0KdIZKsFAfEaSrbaVRCkv93tNacnm+6iT5bZZ26rIEo2Yt2H36q5XTXMKjSHBs5l6VQ== 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=4oa3g8W3PzpoyhK3OXaDaytYbc9UcglW/PBetLTGnB4=; b=DeVl49/fQ9naMYC/4yPb4T9niDoMTpxbjwdpL0is6DbU+akhJVOjWPRp+/fgtP4HgN3n5Dtc+w5TurYCVi/lzb8bWP4afY5CxfvDfLJdOa4Onw+vc+aHoHw6EwAskraea6kaBqCSjxziBGJhHSICBzwbTeOfkO9OmZEzeMz8rk+6LHAC/lGMU1AHqIjsMo50PB/ATJUXOuRvwrIdBFGKvqypQeJTvrdCMrR1ktj0npTBbQU9Qs0yWoe5HKEudJw8pGqj/ac4wg2kWr8/BL8xP1FUcv6t4EF2R8nOYvsSTT2sZ2X2brWFBM5pbgxEW6Xz1Gg2BTssO6BBI04dqwsdbw== 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=4oa3g8W3PzpoyhK3OXaDaytYbc9UcglW/PBetLTGnB4=; b=leKVbBGS4RlgIiDzW1YOcA5lxyfmT/k+tFX/v5RyH8fjQIPu9jlA081fdq6+xJIqqyGOLEya9tVfGCLCZMih0OIczNfrBQvztQe5+YxH8qb7EOJMUH+aRedxbNnriLr96P6a34Z03blD714B7uKsxzvwYaO1jGldEGyG2bfjMe8= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by MW4PR10MB5752.namprd10.prod.outlook.com (2603:10b6:303:18d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.29; Fri, 8 Dec 2023 17:54:05 +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.028; Fri, 8 Dec 2023 17:54:05 +0000 Date: Fri, 8 Dec 2023 12:54:02 -0500 From: "Liam R. Howlett" To: Kees Cook Cc: Andrew Morton , maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mark Brown , Naresh Kamboju , linux-kselftest@vger.kernel.org, Linux ARM , kft-triage@lists.linaro.org, regressions@lists.linux.dev, Will Deacon , Catalin Marinas , Dan Carpenter , Eric Biederman , linux-next@vger.kernel.org Subject: Re: [PATCH] maple_tree: Fix mas_prev() state separation code Message-ID: <20231208175402.hvy2htzs45oa5psx@revolver> Mail-Followup-To: "Liam R. Howlett" , Kees Cook , Andrew Morton , maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Mark Brown , Naresh Kamboju , linux-kselftest@vger.kernel.org, Linux ARM , kft-triage@lists.linaro.org, regressions@lists.linux.dev, Will Deacon , Catalin Marinas , Dan Carpenter , Eric Biederman , linux-next@vger.kernel.org References: <20231207014104.n6vul2ylgqjnsfia@revolve> <20231207193319.4025462-1-Liam.Howlett@oracle.com> <202312071302.99D5B1BB76@keescook> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202312071302.99D5B1BB76@keescook> User-Agent: NeoMutt/20220429 X-ClientProxiedBy: YT4PR01CA0232.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:eb::7) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|MW4PR10MB5752:EE_ X-MS-Office365-Filtering-Correlation-Id: 4652afb2-d85b-4d9e-5807-08dbf816ab7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +Vt5Erlf6doOkW5y1E1rnz8upVHYfUPf4HxAHXvTPUvD7DYexNPp5WNZnuFSTvwQR5FgOZV2QEY6kFO9M0kGZQhP1+gHCcUSHbHCaElqRLYnVjoTB17fsPd+mMyWW3Kk56Xwr5OJxmJLrqS7OEh1AeNZniSLsqJs2ZCUZdGioiFAubWhcx7zPoQTJtDNUh6v+sTQP0RPj3ejWEmHB4BO9LfQXg1cjpvmYGQN2GTdNQtfXvZ1AFGHx2LES4xIpMKQfEIdHO0NPqiEnhf4PRnN4PCSr7FdL8OOwjlGxK9nZo57IOcLpvLx2x+bGX8We2Z4WVOxLsUyVhiIawGyRGFKc4gDEdnqMt+HwwzAtaH3IcsH6TDb4PO3usKyeJQQNS3Xoc48Ee0FOEjvwBLZcclzpnuuAkwCFzHq27+TUnSxZDMDySof9J76xbfHDHtL2rnNN1mkbbIgLCWb8TfXKlxGaIajnGHy56Q/LOQrJE/tNBUioy2VlWPkJ7jltP14Kxr7Zx9RLVJ2RBDAmD3/JL9GAzH7if6gDJoAH7pt2vR4Z1Y= 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)(7916004)(366004)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(1076003)(6506007)(9686003)(6512007)(26005)(83380400001)(33716001)(8936002)(8676002)(2906002)(41300700001)(4326008)(5660300002)(7416002)(66476007)(6916009)(316002)(66556008)(86362001)(54906003)(66946007)(478600001)(6666004)(6486002)(966005)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DvOs2WnHxYRg4dyoPmMZBJQ15vlg1xTK0Hs5ZAki2hOCEAvmvbJswA9bm9ds?= =?us-ascii?Q?6kd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Hwop0sGC8f5iirjFPE?= =?us-ascii?Q?LWoRwfGnTc5qvYYJ1iUGZQorjv1VeoJ7rH+HJ7jReKDgcYugyAcYizeV6OwI?= =?us-ascii?Q?u8R0YN7YIxba7aPStEN6CtnEsPutYNYPDqZeZRLn+niIIMp9dMSAFgUtnYrN?= =?us-ascii?Q?9UmhMlAJDfnyZrLTt8cUay6cmZcuQjimyEoPW7eoW3M4zwBFio7i+Cz8yGZ2?= =?us-ascii?Q?Ji+HI9B9qFHsH3MSlKaL4MqEeSAY3CKznyheF5RVEqv6JqHIr7gW5nnmw3ON?= =?us-ascii?Q?C5JjaKvyHAPAGLA+7JqUHH25h4CIM3IGHo4nVfwWqPD/KqmjPpd+9efMVp63?= =?us-ascii?Q?lZaPirGzKz0R4x5KYi5Al4wQB8js4v72hq1vtxrXMHsmnvcGWFEj6nGteLLY?= =?us-ascii?Q?eJAnD6nzTPKVt7x/GvbUZcRbGMjPOT32Ha3GpdRQKmLO+uKREKvmab8mfiKv?= =?us-ascii?Q?NZR2eJTLR9vjMAmeoKrmShdcn+xUqmMzNYrN1j6fXNHirFRrhxS3cyhD33i9?= =?us-ascii?Q?PJ5evRgPb9IpvmXLmv1a4uK04CqoWSJDoeHzM/CrLbEauldxS7J+AASTQ4+r?= =?us-ascii?Q?6B5wpIkax0S6bPd8TYkhKIaZ4iCuaP0mbKy7hU+41ehfqVRKCU8kfTtIcmty?= =?us-ascii?Q?iefXtka7Gkuh4ZnBlYOnGUxVDpedRl+/Ilbkoim1?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?us-ascii?Q?5I6eJVDrGytBeEqfKyNJSa8RSo38rkyy0tA0jIrvASo3LmOxe1Yu1I+Afhng?= =?us-ascii?Q?HTsDd9mgGqrr7VJc5kRvk5ooklR7kd0yrrREyr6aR/tzy2rRIdqPGoH65U7Z?= =?us-ascii?Q?l0kLngmMnS7XOsr3TnDZdQzQb5b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rQm?= =?us-ascii?Q?q4MjtMpzUTKTznJbfqfJJCI9UhI5R1dOKTG7AeBxBkjSiSYcz5HZmTwv48UH?= =?us-ascii?Q?CMEw4gUy+snKTkP17pHC17/q6zyrkB/HxczYVNzSA97UYVXNUFIqLD1B/70u?= =?us-ascii?Q?X2ttCSEFot12?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4652afb2-d85b-4d9e-5807-08dbf816ab7f X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2023 17:54:05.4938 (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: +EhxsrkIHnf13i4qaBqyNjBNDelfLQlIHTv5DQDXAkn6MhVY2v5YaR8DGLvMAJaL1FkOuLJ4gp4NvdT3DfYw6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB5752 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-08_12,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-2312080148 X-Proofpoint-ORIG-GUID: WH9UxD5ozggxI_0sRq2IZJ2AYYOdKHqC X-Proofpoint-GUID: WH9UxD5ozggxI_0sRq2IZJ2AYYOdKHqC 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 pete.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 (pete.vger.email [0.0.0.0]); Fri, 08 Dec 2023 09:55:17 -0800 (PST) * Kees Cook [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 > > Is this is related to the report[1] I forwarded? If so, please add these tags > too: > > Reported-by: Linux Kernel Functional Testing > 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