Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6536669rwb; Mon, 5 Dec 2022 13:55:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf7QpYklg7g0uZ/5NLxT7hbiZlUWCQdUv8U+P2COhnQuqjEfgmYBhiTHQUa4T4qVIpgQR3IW X-Received: by 2002:a17:90a:7183:b0:212:ede4:3c19 with SMTP id i3-20020a17090a718300b00212ede43c19mr92923926pjk.151.1670277309296; Mon, 05 Dec 2022 13:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670277309; cv=none; d=google.com; s=arc-20160816; b=U/xSI+madVAy3FpUWLP3YQLF7Uz5seSwwd13g1wbyJNemdHzxsrSyx1IL8ufPrV/+Y 6u5WPXqjcqMtBx7uBZ/WYiXZXnjQZ6fmniikE4n5wIzpLbfMbxUeMj0KewBRsGQv3kR2 QSQt6P+irTJpHbiUEfJNDsqwz5gC1zXUIg2ct+/VxANzcEpXcvtvgllAX12jhUfZFEeO MJ40b//khf0Fg38V+R5xU9JDo+M04+VSwchh3tkACEaXKa0mZTk0keNByr/0iXjLym3O l81PtB+coXszyTeNjKHRwNbz/q0E6dwjYR25MRKkOcIRzryzE7KPGDLUCgcH/k02XxUT aiQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=lbXXokK3tmwql/z0cJl15lHdxkbhCEj/Cchuvb8Z1LQ=; b=FCiSn70rmaSNYGQv4Cao00JSOYCoONWAYZjSB4zXS0EbHwyhux61Nvdj5kIoN9X+H8 OzFZ7zIPyUqCkGcz+FNNgEiKDvg+wsIeoQSNsuBZ85G27Ati2LsBY06YSBqY36m5RnW+ I87SrghzkuH6ql8Jq49bBZZK2f5f6sU8iCPyfQNRhNcVy/Mho09BxmbRnILnh0KjYbtL Pqo8e1m8xg9qHQlP1wngztJxa/xICnXX1UvPDw1nok+C/4h6Kn7qmrU4kHxsfOBUq4Tg IqkVsorRhtlz9eGec1+ZPa8Wg4bj9XasytRjxoUW3+E4K/z1+z+WPQV1VT80rAAhuLRx ptbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="O/hMUbqT"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e67-20020a636946000000b0046ed15af9d1si7880632pgc.213.2022.12.05.13.54.58; Mon, 05 Dec 2022 13:55:09 -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=@linux-foundation.org header.s=korg header.b="O/hMUbqT"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233282AbiLEUdD (ORCPT + 80 others); Mon, 5 Dec 2022 15:33:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233430AbiLEUc4 (ORCPT ); Mon, 5 Dec 2022 15:32:56 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B88E2E66 for ; Mon, 5 Dec 2022 12:32:55 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id D8150CE13B4 for ; Mon, 5 Dec 2022 20:32:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 749EDC433C1; Mon, 5 Dec 2022 20:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1670272371; bh=515qPF4ILAV8vNYwyWFbsUeaPOTzvoOjmq/jBopabaQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=O/hMUbqTKq2RpqhtLTtSqvnB3UePKDLYa4bTgvhyBCituIaZq4/FEhJugYyOdqR+Q SuS9dEKxP42yQfYIkuFhoSHa3VK3fy5468En0AEt0mvdRoQZtTA0zye3V7+Ahal8wx vff0ASaVF0gOM0MBWn4BS70YfOOOmS0OdBNzNlMc= Date: Mon, 5 Dec 2022 12:32:50 -0800 From: Andrew Morton To: Liam Howlett Cc: "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Yu Zhao , Jason Donenfeld , Matthew Wilcox , SeongJae Park , Vlastimil Babka , Jann Horn Subject: Re: [PATCH v2] mmap: Fix do_brk_flags() modifying obviously incorrect VMAs Message-Id: <20221205123250.3fc552d96fcca5dc58be8443@linux-foundation.org> In-Reply-To: <20221205192304.1957418-1-Liam.Howlett@oracle.com> References: <20221205192304.1957418-1-Liam.Howlett@oracle.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Mon, 5 Dec 2022 19:23:17 +0000 Liam Howlett wrote: > Add more sanity checks to the VMA that do_brk_flags() will expand. > Ensure the VMA matches basic merge requirements within the function > before calling can_vma_merge_after(). I't unclear what's actually being fixed here. Why do you feel we need the above changes? > Drop the duplicate checks from vm_brk_flags() since they will be > enforced later. > > Fixes: 2e7ce7d354f2 ("mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap()") Fixes in what way? Removing the duplicate checks?