Message ID | 20230130195713.2881766-1-Liam.Howlett@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2370745wrn; Mon, 30 Jan 2023 12:04:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXse45yOHa2R6gM0XTjQtZFhefQYvnSuD6i98o4lpRY8l34xY4accIJp55Qo6w6HEIshxUDj X-Received: by 2002:a05:6402:413:b0:499:d199:6614 with SMTP id q19-20020a056402041300b00499d1996614mr52983409edv.36.1675109072578; Mon, 30 Jan 2023 12:04:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1675109072; cv=pass; d=google.com; s=arc-20160816; b=w5ScdsySoDKPZ3vCNMmcwWFohAq5HJDNqvabw027LONPA6WD7XDPx71SSB4rSisL+7 ZK7kPnUlP/XHrXSPXoK5i57J/V0tpJ8FgmX3F2iy4MHb47S5BCzdoDK1rYM8ixt5w6Y9 D3O8DagInNN5SEikLEBitIOH8nY4GSaJG4e8U/SCJpBfy6jjhM6F0M1sM8fOYs1+UnYE wiFXwSsLwr70gQL443aEjCs9gkungrvu3kJNVMXs0n0RWH8vHuIcxNNSkPsvmeoNu0Z3 XZMOSRVqowyA8Lj+XowGTtjm/V3/cUN+3a4aBX2JGJbOB87FdZiyLxIvDzA/XKCobJZh cymQ== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=g1jP3cdvFI/zvbYJ77Ge44NpJkobjOgl0GO44UZQsuw=; b=p1S0aeC93u0be/yLIPGEQUaPJ5mhr7ef8Yc2nHlKUFUsK+EHOPUqS+i/GjZowB+mz5 sSLWBOKXq3pBWoeN2SiGJBu+yxaUTTF3x4dC5kolG18V14drFTF1fT4Gy3eRXKEA7wV3 AtV/tCvngimjyxml4dfw9noPxw1zBYsi1g9F4R4GO3VUqnhsC2oMgB5gpiCrq7DxknHf FDtveWojBN3vinLTPy6nUu+A3cs9OVh+ZpaBloxnohxN5BFuG9JmxCdsQmX0GS2n8Hfk y6/oxzDLPVo5d9ehaEW9IpxR6EhPxF6MQug20umDpceJb/5D1/CnN6pVtnWNAV/cYcmc R4uw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=2YwSKr6Q; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=VBIdMORk; 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::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i23-20020a0564020f1700b004a089f0ea89si17203279eda.312.2023.01.30.12.04.07; Mon, 30 Jan 2023 12:04:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=2YwSKr6Q; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=VBIdMORk; 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::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236672AbjA3T5k (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Mon, 30 Jan 2023 14:57:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234742AbjA3T5h (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 30 Jan 2023 14:57:37 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9ABF3D0AB; Mon, 30 Jan 2023 11:57:35 -0800 (PST) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30UHXhBD011874; Mon, 30 Jan 2023 19:57:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=g1jP3cdvFI/zvbYJ77Ge44NpJkobjOgl0GO44UZQsuw=; b=2YwSKr6QNHJ+ctW7a17HOKLNckWpkaB71HixhhGAP/0Wq5xIcAwU6y+YesN5AHUtU4O6 /zWqRubIGZQIaUPhxVrQ4fPnBs3Ghn0MaFhinFLgqOrmfdKUeTWwD5sDkROXTMPcGL3D sOJRKCPwGo8MAyn60lxnN09BR25eSi9ngtezFV351JpDyVX70o2ArI78dlmxIdvEbR+f irnHUOoKvteCErTIY8ZCtCgGHUtkuSm9gCWMQK+d5p/3VhoXeXEyTipQGxhnNwf+TWs9 csP96Dc3AIuDhuQH5h3R+8/XLSqHsucLRObA7vwaQ01ykBLlZ3wSyMIW65UMsAdjCJvl OQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3ncvmhkukk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Jan 2023 19:57:20 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30UIGccI020456; Mon, 30 Jan 2023 19:57:20 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2104.outbound.protection.outlook.com [104.47.70.104]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3nct5bc4f6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Jan 2023 19:57:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LB6gcSmxNk4ZqGbDJCemf8etW6TyWHT36QgB25lwesVh2GizAFz+SJemoRZghcO2YFCzhmUfADKC6gq1qG4Q2HGQVQtVc+jjw7ZaJUnvqH3xpbShJfIC0Fp6UBq3aHBLwfsKDQhtu+nYKADKT4EY2+uiE7DDl8L3egHYQtSsz+LyH2P/+lFlGgkvpUmsHb0GI7Ce0WcNjToqvykG6KpBxkVtHlCgqCNacnAMx3wB3xuvy9bVs5oQyqBaRvYxcAvez3OOAlSaQmVuuKcdBLr7bNcXfHNTHl8Jnrrlaj6LzNSj4enrtVVa5jor9+RHJ1xsaTZdV4H/XfKgJo76LOOsDw== 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=g1jP3cdvFI/zvbYJ77Ge44NpJkobjOgl0GO44UZQsuw=; b=NTHzROOxo6i0QMBuTg0NjR3KHHmQ/D9O8YjcoqmWz7XsFxnolHj2FWLjRa6z2z2jo+ZJn+wFonj+gR4t/1TuNdyHNtCNwJ4klrAlDFkpXttmu7f+MWRm7tbxSsYpvEX15KydoTk+aINPGeIEUa9lehlvg+OCG7KvuYkS2mF29IXWo4PAsHmiqfBmGaT+RgGeio3A2U9Ih2wTDrTLdnIw0KuHvUdmWDngd+ok9Ha6JqLLOPQ1R0f4Y/Hbtz4+4AMY9r14JbUu8NOcyTJy1LlhSBYkND/5vcwEZ2EzAyEjXROJxkKtvsmWsr4XjxK9Bm09KEkaIPIXiArBJkd9Cnr8tw== 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=g1jP3cdvFI/zvbYJ77Ge44NpJkobjOgl0GO44UZQsuw=; b=VBIdMORkDVQYBkGAjhjGUVsacQ4Oqo8Ae0TCWAoOS55Mgq32bWb52dhTehD7/7desVvT53KRVGEpcSH4r12pOdxsGYhnCBavGAu1eclau0jJeOqvk+z912t92oczfeSR76lLux+a5tGs33HzX3awD9ft5gE4/nfNc6a4RCNzQeI= Received: from SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) by PH0PR10MB4776.namprd10.prod.outlook.com (2603:10b6:510:3f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.21; Mon, 30 Jan 2023 19:57:18 +0000 Received: from SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::7306:828b:8091:9674]) by SN6PR10MB3022.namprd10.prod.outlook.com ([fe80::7306:828b:8091:9674%5]) with mapi id 15.20.6064.021; Mon, 30 Jan 2023 19:57:18 +0000 From: "Liam R. Howlett" <Liam.Howlett@oracle.com> To: maple-tree@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>, linux-next@vger.kernel.org Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>, Sanan Hasanov <sanan.hasanov@knights.ucf.edu>, Matthew Wilcox <willy@infradead.org>, David Hildenbrand <david@redhat.com>, Hugh Dickins <hughd@google.com> Subject: [PATCH] mm/mmap: Fix vma_merge() offset when expanding the next vma Date: Mon, 30 Jan 2023 14:57:13 -0500 Message-Id: <20230130195713.2881766-1-Liam.Howlett@oracle.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: YT2PR01CA0014.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:38::19) To SN6PR10MB3022.namprd10.prod.outlook.com (2603:10b6:805:d8::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN6PR10MB3022:EE_|PH0PR10MB4776:EE_ X-MS-Office365-Filtering-Correlation-Id: ae3daeb5-41e1-4e0b-031d-08db02fc30f1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v0Qb1wvviP0x9lllg+iNfZctSeCGNCyyftSdO68gUt61xndlxdsDIK33AH1ml0NbK9TXkrfISELzwlSr01GVeymYuH23D18EFxGW+B+B+mAjF0OpHLortwLihj4rn3poE+D5wFtsahmnZFhlKO+bsrLVuXIW6o0Mdjeqheq53V5g5ZXtKo8P/SI3aMnc8tyk7K2xxEwA03H3VwJ0a8LF6N+xiUUI7BRaqJE1tb9cwPDd5jKEflBFdKnsHpwaeZ2XxfODBqVbfLCnIBPGgu1/6Ks7y819u4yFixMHdLKaT3WFgoRQYtv58XzpcC+eOS0AgjA50X7uc2nZjA6MStp8bl6WHIRb2yz1252uxES4f48tQQDiPwbcAgCSqBxxR/d24Dy0QzMk+BCnN+Xzcg0n5GvzgBTQE1Wf9PdyvSH1a9tWKTF2zmaK9xXmJx2xDhH/Ni7SmliMMRejNyUaDval22nkDkiJQpfwrVMLKP/jI3KCFO86BVqinA6yHtJPW8gW5Y9lPQ/7byLGhEpPzc/E7iI8iBjjETc4Q1WvlA930LHeFMRWuGTWBV0tGDq52QhwlGtn6/LzsBLgFKPTJKI50VmMZtlsQNIVCFaas4FyikW0rScMAICjGjiqsm+GvW+V6Sk9ZYNd1QOScT/NxO/N7iPnfBtojnPErdYtLxrOqs0= 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:(13230025)(366004)(396003)(39860400002)(346002)(136003)(376002)(451199018)(4326008)(41300700001)(8936002)(8676002)(66556008)(66476007)(6666004)(66946007)(316002)(966005)(54906003)(5660300002)(83380400001)(6486002)(36756003)(45080400002)(2906002)(26005)(478600001)(6512007)(186003)(1076003)(6506007)(2616005)(86362001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: v2zkBL6DiPjevqlVEO8XGJD1NDj/Ee+MlTeyh+7HLn+zGK9l9v+dGNBdcjSJ3FSrE7+gP1I1Y+jzWrU6t0bhlrZV23j6exv5qoBYRnGKADq7YrfXsMuQd8cIxQ1GQhP2VMTg1gJ7nctkvKqzcWzKcnPp0khMYvj/ip/5KaNeTnFfk5h4RGuPOcLLa14b/JH8dZLSvq8DudMj0253jbxpPBLfCrwHUxmXNRT7D5j1qWS1GyE7+yskSdPuoFpyIR/pJwh3Tvh/IDPI9XRplekVUJQUGTppmzWits/glNkhfB1eNvzkW5MofpId2ggwngIXJ7Z7sBzanQiNzvBHCZ7UQi7X/e1ezhr7TyjSZGHExxbgyceReiljcUoPMaaOisfYK51JIoy9J5W3VYtigE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7vVRi15GPgt8JebgSx6pKoxX4jvJ718umLlYDOzTBxwZg89GZgbpkXr5Ufs08zrlAhb+hka9ioiYyXp/FAYPoKWB6stCIW367Nb/yACZBymguBCooUEqJE5KbPWl2U87mV3NAq4pPzYIqC6rcs14/n4JqjjmiS66rHy1eplcmv6i8Jqn2wKFCry/zWNfe7eT61ZoQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae3daeb5-41e1-4e0b-031d-08db02fc30f1 X-MS-Exchange-CrossTenant-AuthSource: SN6PR10MB3022.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2023 19:57:18.0266 (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: TBbId8tAZFcyqc+L7w3sN++MVcSuWapJKfcNMZ926k589SpZkwRWtzitI0/bJtJoY/oaDHVJx042jeR4MFuhvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4776 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-30_17,2023-01-30_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 suspectscore=0 adultscore=0 mlxscore=0 phishscore=0 mlxlogscore=952 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301300186 X-Proofpoint-ORIG-GUID: o_47QlAEe9vK1DVzYIAuNOXBdt8CKP_X X-Proofpoint-GUID: o_47QlAEe9vK1DVzYIAuNOXBdt8CKP_X X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756479171136193939?= X-GMAIL-MSGID: =?utf-8?q?1756479171136193939?= |
Series |
mm/mmap: Fix vma_merge() offset when expanding the next vma
|
|
Commit Message
Liam R. Howlett
Jan. 30, 2023, 7:57 p.m. UTC
The vm_pgoff was being set incorrectly when expanding the next VMA to a
lower address. Fix the issue by using the mid->vm_pgoff value for this
merge case (aka case 8). Note that this does not change case 3's
vm_pgoff as next and mid are the same VMA.
Reported-by: Sanan Hasanov <sanan.hasanov@knights.ucf.edu>
Link: https://lore.kernel.org/linux-mm/IA1PR07MB983017D2FBA174D2FF78CEB6ABCE9@IA1PR07MB9830.namprd07.prod.outlook.com/
Cc: Matthew Wilcox <willy@infradead.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
---
mm/mmap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 30.01.23 20:57, Liam R. Howlett wrote: > The vm_pgoff was being set incorrectly when expanding the next VMA to a > lower address. Fix the issue by using the mid->vm_pgoff value for this > merge case (aka case 8). Note that this does not change case 3's > vm_pgoff as next and mid are the same VMA. > > Reported-by: Sanan Hasanov <sanan.hasanov@knights.ucf.edu> > Link: https://lore.kernel.org/linux-mm/IA1PR07MB983017D2FBA174D2FF78CEB6ABCE9@IA1PR07MB9830.namprd07.prod.outlook.com/ > Cc: Matthew Wilcox <willy@infradead.org> > Cc: David Hildenbrand <david@redhat.com> > Cc: Hugh Dickins <hughd@google.com> Fixes: ? > Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> > --- > mm/mmap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/mmap.c b/mm/mmap.c > index 00d90bbc250e..614ea2d93b0a 100644 > --- a/mm/mmap.c > +++ b/mm/mmap.c > @@ -978,7 +978,7 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, > vma = next; /* case 3 */ > vma_start = addr; > vma_end = next->vm_end; > - vma_pgoff = next->vm_pgoff; > + vma_pgoff = mid->vm_pgoff; > err = 0; > if (mid != next) { /* case 8 */ > remove = mid; Acked-by: David Hildenbrand <david@redhat.com> Thanks!
* David Hildenbrand <david@redhat.com> [230131 03:35]: > On 30.01.23 20:57, Liam R. Howlett wrote: > > The vm_pgoff was being set incorrectly when expanding the next VMA to a > > lower address. Fix the issue by using the mid->vm_pgoff value for this > > merge case (aka case 8). Note that this does not change case 3's > > vm_pgoff as next and mid are the same VMA. > > > > Reported-by: Sanan Hasanov <sanan.hasanov@knights.ucf.edu> > > Link: https://lore.kernel.org/linux-mm/IA1PR07MB983017D2FBA174D2FF78CEB6ABCE9@IA1PR07MB9830.namprd07.prod.outlook.com/ > > Cc: Matthew Wilcox <willy@infradead.org> > > Cc: David Hildenbrand <david@redhat.com> > > Cc: Hugh Dickins <hughd@google.com> > > Fixes: ? Fixes: (soon to be invalid git id :) ("mm/mmap: remove __vma_adjust()") > > > Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com> > > --- > > mm/mmap.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mm/mmap.c b/mm/mmap.c > > index 00d90bbc250e..614ea2d93b0a 100644 > > --- a/mm/mmap.c > > +++ b/mm/mmap.c > > @@ -978,7 +978,7 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, > > vma = next; /* case 3 */ > > vma_start = addr; > > vma_end = next->vm_end; > > - vma_pgoff = next->vm_pgoff; > > + vma_pgoff = mid->vm_pgoff; > > err = 0; > > if (mid != next) { /* case 8 */ > > remove = mid; > > Acked-by: David Hildenbrand <david@redhat.com> > > Thanks! > > -- > Thanks, > > David / dhildenb >
On 31.01.23 15:24, Liam R. Howlett wrote: > * David Hildenbrand <david@redhat.com> [230131 03:35]: >> On 30.01.23 20:57, Liam R. Howlett wrote: >>> The vm_pgoff was being set incorrectly when expanding the next VMA to a >>> lower address. Fix the issue by using the mid->vm_pgoff value for this >>> merge case (aka case 8). Note that this does not change case 3's >>> vm_pgoff as next and mid are the same VMA. >>> >>> Reported-by: Sanan Hasanov <sanan.hasanov@knights.ucf.edu> >>> Link: https://lore.kernel.org/linux-mm/IA1PR07MB983017D2FBA174D2FF78CEB6ABCE9@IA1PR07MB9830.namprd07.prod.outlook.com/ >>> Cc: Matthew Wilcox <willy@infradead.org> >>> Cc: David Hildenbrand <david@redhat.com> >>> Cc: Hugh Dickins <hughd@google.com> >> >> Fixes: ? > > Fixes: (soon to be invalid git id :) ("mm/mmap: remove __vma_adjust()") Ah, right, upstream was not affected ... :) ... so this should be squashed into that commit instead as long as it doesn't have a stable ID.
On Tue, 31 Jan 2023 15:29:59 +0100 David Hildenbrand <david@redhat.com> wrote: > On 31.01.23 15:24, Liam R. Howlett wrote: > > * David Hildenbrand <david@redhat.com> [230131 03:35]: > >> On 30.01.23 20:57, Liam R. Howlett wrote: > >>> The vm_pgoff was being set incorrectly when expanding the next VMA to a > >>> lower address. Fix the issue by using the mid->vm_pgoff value for this > >>> merge case (aka case 8). Note that this does not change case 3's > >>> vm_pgoff as next and mid are the same VMA. > >>> > >>> Reported-by: Sanan Hasanov <sanan.hasanov@knights.ucf.edu> > >>> Link: https://lore.kernel.org/linux-mm/IA1PR07MB983017D2FBA174D2FF78CEB6ABCE9@IA1PR07MB9830.namprd07.prod.outlook.com/ > >>> Cc: Matthew Wilcox <willy@infradead.org> > >>> Cc: David Hildenbrand <david@redhat.com> > >>> Cc: Hugh Dickins <hughd@google.com> > >> > >> Fixes: ? > > > > Fixes: (soon to be invalid git id :) ("mm/mmap: remove __vma_adjust()") > > Ah, right, upstream was not affected ... :) > > ... so this should be squashed into that commit instead as long as it > doesn't have a stable ID. Yup, I queued this as mm-mmap-remove-__vma_adjust-fix.patch so it's to-be-squished. Generally, please let's tell people when a patch fixes something which is staged in mm-unstable - to save a few brain cycles and to hopefully improve review. A Fixes: with no SHA works, or simply "this fixes X".
diff --git a/mm/mmap.c b/mm/mmap.c index 00d90bbc250e..614ea2d93b0a 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -978,7 +978,7 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, vma = next; /* case 3 */ vma_start = addr; vma_end = next->vm_end; - vma_pgoff = next->vm_pgoff; + vma_pgoff = mid->vm_pgoff; err = 0; if (mid != next) { /* case 8 */ remove = mid;