Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27346773rwd; Tue, 4 Jul 2023 01:27:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlGl4uw94QQ+Ar3LaZuwLDCYFIaYeKuTJPPOUXj2g1P8XClr799r0q/mwXRNvXKux1FqVpMJ X-Received: by 2002:a17:90a:1344:b0:263:6aee:43be with SMTP id y4-20020a17090a134400b002636aee43bemr9325451pjf.33.1688459273719; Tue, 04 Jul 2023 01:27:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688459273; cv=none; d=google.com; s=arc-20160816; b=xrDTqx3REUO5a3tGJe6qKKL8GJPWX6aejYCMcmJrqmbYjmy1b/WFBrlPfGCbNcck1w Hcb9tjwhOAKPlE8Y70F9WLJkE9L6IYl5jdMcHy29z44QBjiJ5PXs2eXP2K1bumoPB0H9 DOQlWT+KbDOMTZEpOleKb4D6sPYB5uwhX43bm0aX8MxFMeIeMxnTQjZeysBuHdYnf/5u KO0qR0A8o0kaQYdmtOndcWnFtm/OOUI/cMKAfsu38ll6HHWtwl8Fg5XdymMtF/rTfEzj cFF5feAinPKY8xi5nE8kNL+75DkCCmi8vjl6KwjJel+h1sH8OyzQKiPIWKu+j4vjvWRd 9lgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=A7vP8NYOlAspz9ryOGIy4uTJ/Y4Bem0/evq8oRa6UzY=; fh=T4w2KTb745NG2ERzAH7XEgsurhetefeAx9rvmB96TZ0=; b=s1yCR8rlsNS8KLfLKRiWN89lYQ44BaCLzgUT/nHArJ+j5kPVuo+cjXOAqGnZ/OFdit 9ovmsN9bzu9Qs/1EhOEAYOXo6wxUWkVLzHkijD60Z0FwqOymscI88Y4jFH2ISYeWAwY1 9I6C4/bhtsSnfrCyQy/JMc4yGJiWDrAHOX6NAk6lTO64yrwb1Resi8yzV4WXx7vhjqPX VaL1DfcmadIOpAqNYcxMXoUX+k2905/YLpUQ4YavtwCl66I4o39msmAMHoflABlsqFcl BcLy91XMDQewQzcSTQ0edEcHZKG/W3dXAxhAlUoiIODkCTFcHyMDJaedK/6r9dbCdged D/vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XHp+Hs2J; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oo6-20020a17090b1c8600b00259b2f52633si22389402pjb.166.2023.07.04.01.27.40; Tue, 04 Jul 2023 01:27:53 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=XHp+Hs2J; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230402AbjGDIAZ (ORCPT + 99 others); Tue, 4 Jul 2023 04:00:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjGDIAX (ORCPT ); Tue, 4 Jul 2023 04:00:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85F61BD for ; Tue, 4 Jul 2023 01:00:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 226CD6117C for ; Tue, 4 Jul 2023 08:00:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E6B7C433C7; Tue, 4 Jul 2023 08:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1688457621; bh=vU2jOdZ5LLyWKgEHZBnAwSo71oT39lJC++2uk0MUGbk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XHp+Hs2JhHl1RFxbfZK/NaC++Nys7AA/C7FARVmMBKrYYsKSWOIXthZX1iXpeUyvH mgHmFrS0zclbCWqAYoKQ/ydbtN9SHJC3UQL4Gess9n1x4aEI+vjtv80YqkFMDU6VFp AqPAyovltrHCKeutz1bcCPNgSjyII3zCgoWE2F04= Date: Tue, 4 Jul 2023 09:00:19 +0100 From: Greg KH To: Suren Baghdasaryan Cc: Linux regressions mailing list , Bagas Sanjaya , Andrew Morton , Jacob Young , Laurent Dufour , Linux Kernel Mailing List , Linux Memory Management , Linux PowerPC , Linux ARM Subject: Re: Fwd: Memory corruption in multithreaded user space program while calling fork Message-ID: <2023070453-plod-swipe-cfbf@gregkh> References: <5c7455db-4ed8-b54f-e2d5-d2811908123d@leemhuis.info> <2023070359-evasive-regroup-f3b8@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Tue, Jul 04, 2023 at 12:45:39AM -0700, Suren Baghdasaryan wrote: > On Mon, Jul 3, 2023 at 11:44 AM Greg KH wrote: > > > > On Mon, Jul 03, 2023 at 11:27:19AM -0700, Suren Baghdasaryan wrote: > > > On Mon, Jul 3, 2023 at 11:08 AM Suren Baghdasaryan wrote: > > > > > > > > On Mon, Jul 3, 2023 at 2:53 AM Linux regression tracking (Thorsten > > > > Leemhuis) wrote: > > > > > > > > > > On 02.07.23 14:27, Bagas Sanjaya wrote: > > > > > > I notice a regression report on Bugzilla [1]. Quoting from it: > > > > > > > > > > > >> After upgrading to kernel version 6.4.0 from 6.3.9, I noticed frequent but random crashes in a user space program. After a lot of reduction, I have come up with the following reproducer program: > > > > > > [...] > > > > > >> After tuning the various parameters for my computer, exit code 2, which indicates that memory corruption was detected, occurs approximately 99% of the time. Exit code 1, which occurs approximately 1% of the time, means it ran out of statically-allocated memory before reproducing the issue, and increasing the memory usage any more only leads to diminishing returns. There is also something like a 0.1% chance that it segfaults due to memory corruption elsewhere than in the statically-allocated buffer. > > > > > >> > > > > > >> With this reproducer in hand, I was able to perform the following bisection: > > > > > > [...] > > > > > > > > > > > > See Bugzilla for the full thread. > > > > > > > > > > Additional details from > > > > > https://bugzilla.kernel.org/show_bug.cgi?id=217624#c5 : > > > > > > > > > > ``` > > > > > I can confirm that v6.4 with 0bff0aaea03e2a3ed6bfa302155cca8a432a1829 > > > > > reverted no longer causes any memory corruption with either my > > > > > reproducer or the original program. > > > > > ``` > > > > > > > > > > FWIW: 0bff0aaea03 ("x86/mm: try VMA lock-based page fault handling > > > > > first") [merged for v6.4-rc1, authored by Suren Baghdasaryan [already CCed]] > > > > > > > > > > That's the same commit that causes build problems with go: > > > > > > > > > > https://lore.kernel.org/all/dbdef34c-3a07-5951-e1ae-e9c6e3cdf51b@kernel.org/ > > > > > > > > Thanks! I'll investigate this later today. After discussing with > > > > Andrew, we would like to disable CONFIG_PER_VMA_LOCK by default until > > > > the issue is fixed. I'll post a patch shortly. > > > > > > Posted at: https://lore.kernel.org/all/20230703182150.2193578-1-surenb@google.com/ > > > > As that change fixes something in 6.4, why not cc: stable on it as well? > > Sorry, I thought since per-VMA locks were introduced in 6.4 and this > patch is fixing 6.4 I didn't need to send it to stable for older > versions. Did I miss something? 6.4.y is a stable kernel tree right now, so yes, it needs to be included there :)