Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2604103rwb; Fri, 2 Dec 2022 12:09:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf6kF84oCwWAG+Kog4F3/ehWvJrxYwgSZfd0o66iFk9dXhU9Vic9EkJQmTq0sf4hpN21kfvF X-Received: by 2002:a17:902:da83:b0:189:2809:2f11 with SMTP id j3-20020a170902da8300b0018928092f11mr58433233plx.105.1670011768396; Fri, 02 Dec 2022 12:09:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670011768; cv=none; d=google.com; s=arc-20160816; b=fBrs+skX5OS2vSrLs0jeH9hBg47xrpNzb77hSAtYUVFk1Z+xbm13LBZHeAwXk2J4V0 5/GFwyxU5Mp3EdbyngsnXgg8TST9uM1SF7fxjzffonITQjL4MmkYbMBs5tI7ioCx+c/Z +hgTuixyNt30oswKtTdgCyvK9B7gFOth/WFxQBDxaH+SVEQajtAcORclGMnOS4pEQy0+ Uv0hUD9kd8lwRMvbw6gh/s0hutFRthQTSUYmI15fMN37Na5la5nD0EXrXCdevZFkoaFg b3RWcXpCFuP0acre2EhURpfUG76ehG0zaDJYb/pyqCl8IvMdrXDCfgDnZKBU1Uq8Y/d1 wmtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=of7uVX1tXYOzviZXLnVMaGfqQG4lADtgdnHuJ5eU4J8=; b=N7Fbc9L9BFY55uaRypLvlTNiPlpfTkggAKQCVq7l3kfUb+Y3Y9nhtqQoqUz/HYGT7x 2moPfjigo6DXdLcEAQhTaAKNJXZeOgx6XIzVDcVTEFO5KDr4Wj+mmuP+WkL71xU6YXG3 dBbfo5A2YTnpEyg4123lDmfBdBnHS0fziB9E0hlpu1WRnKQujaTxqG5QVT5cpKFsyjsp A0Tztmx+Mea9QIlfkuN4rfsWGH2eJGZGnpCGi3nKQ1Q25N3fiAMlh8sikV6eL3KPvOXK nPJI6cb1ovNf7q6ilvC1CFyldm1gfZAY/qfVNkmLhOUgZYc1el7zhhDhpxcwVAcIFuZp ifQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Hjyg7ElN; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a63b906000000b00477bbd92cfdsi8016340pge.592.2022.12.02.12.09.17; Fri, 02 Dec 2022 12:09:28 -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=@google.com header.s=20210112 header.b=Hjyg7ElN; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234648AbiLBTnT (ORCPT + 82 others); Fri, 2 Dec 2022 14:43:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232517AbiLBTnR (ORCPT ); Fri, 2 Dec 2022 14:43:17 -0500 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5E42AA8CD for ; Fri, 2 Dec 2022 11:43:16 -0800 (PST) Received: by mail-il1-x12f.google.com with SMTP id h15so2484017ilh.12 for ; Fri, 02 Dec 2022 11:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=of7uVX1tXYOzviZXLnVMaGfqQG4lADtgdnHuJ5eU4J8=; b=Hjyg7ElN0qzCGB7na9HaUNn7ciQAT0b5qOatwgrfMuVI8j/sV5jXT0FFQY/GI1o1qC AcczKv1OlDCC2eJzSdLDvg/tSJdISvhiRx2JUnskBQ54VvwOov89yEj+4Pjm4vCMD57Y ehzOk8IOa4UMEVIOZeyyYOx766NiGzY+WI0MPE4EZW2+9KmOlRuoWKFhIm/EzklGuJDK eVo/w9wt/Axw9kLT1MkqxEFIlc30vO989++RzYyvu4zlErOjlCFeJNGWtm1eJWP/DXQa t7yf3zo3aKJx/8lIZk0zMYfs1bpH+FBS4NklapQa6OxLyamj+a8GB9Tuf6quubMFgtbZ kHaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=of7uVX1tXYOzviZXLnVMaGfqQG4lADtgdnHuJ5eU4J8=; b=IIh8Nm4EMmc1GJDPbVR36DernBjJHeFwVKDtDFz2+X/TaM7nZ3aHjxn7dDsFUJSiGo PK2UbO5cUeEZLR4bBT0DuA+FggRch4+Gk5kl13cnT1jsaQ3M+tTDT9HBCN8jW4h872J5 kvNNMNsKRjY19au37pbygeFMiu7KNow91Xy5hfeziy2eQqWMb7e6pBEtDAZHFbyebtJq rRiiVk2M/OL1ZMWE5+gg9Nj/vx96etXX4EUeEv/yon0IUYqnGGxn4TdDEudtsdhnxjrP jPPhzxIU1fEIBfH5RGX+ZWVk/5dHXf4Im4IJf+Wq901EWcK2ewr5eLxDMJhqdqz2uCE4 QWiQ== X-Gm-Message-State: ANoB5pkHe6K4hEnBvb4/s+kgsqzNDY7BcpESNC0Jnatga+bhZXXdbpEY rEmJc5hfpLlCRMu1QIwAuaOydgHYbDW2y3HlwNqn8VbDHnvoNmBm X-Received: by 2002:a92:6809:0:b0:2f9:4d92:5b2a with SMTP id d9-20020a926809000000b002f94d925b2amr24412987ilc.177.1670010196130; Fri, 02 Dec 2022 11:43:16 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jann Horn Date: Fri, 2 Dec 2022 20:42:39 +0100 Message-ID: Subject: Re: brk() in v6.1-rc1 can expand file mappings, seemingly without taking file locks To: Linux-MM , "Liam R. Howlett" , Andrew Morton Cc: kernel list , Jason Donenfeld , Yu Zhao , "Matthew Wilcox (Oracle)" , SeongJae Park , Vlastimil Babka Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Fri, Dec 2, 2022 at 7:53 PM Jann Horn wrote: > As of commit ca57f02295f, brk() can expand ordinary file mappings (but Sorry, that was worded confusingly - I meant "ca57f02295f is the commit from Linus' tree on top of which I was testing". The broken code seems to have been introduced in commit 2e7ce7d354f2 ("mm/mmap: change do_brk_flags() to expand existing VMA and add do_brk_munmap()").