From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54A9BEB64DA for ; Tue, 4 Jul 2023 08:00:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84AF06B0074; Tue, 4 Jul 2023 04:00:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7FA5428006B; Tue, 4 Jul 2023 04:00:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C29B280049; Tue, 4 Jul 2023 04:00:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 5A0C06B0074 for ; Tue, 4 Jul 2023 04:00:25 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 244FBC0968 for ; Tue, 4 Jul 2023 08:00:25 +0000 (UTC) X-FDA: 80973182010.05.28D877C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id 2F1CB40023 for ; Tue, 4 Jul 2023 08:00:22 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=XHp+Hs2J; spf=pass (imf12.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688457623; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=A7vP8NYOlAspz9ryOGIy4uTJ/Y4Bem0/evq8oRa6UzY=; b=IWuizJTYkr+aaJfe/0PYCr4soQMlR5ZztxqbCxeMGAfz9nm2JZyG5Pc3TtXI7DcIi6M2db 7AHLb3qFYgzDmkWGSiUW+OqYVEeW0hQomvUAL/Q1OJRZ6oEj4ONLQ6HY6DehCObhr0MfTT tLG6uB01CWgSxnbHDhMn9+jHPSsADxA= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=XHp+Hs2J; spf=pass (imf12.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688457623; a=rsa-sha256; cv=none; b=65dMYELywXhrlAzqYSqs6F0iCp53ubG7Z+4WBs6+26TH8HZKjk84MlkjjHBHx/gBJOfKbT Sapo9PqahBD4gPrOJO0Lj3o7cF3FcyW8BHuAva8yDgtlpak50AhJNdonw6OQ2B2uaRVAhG aX38XkH80ml6NV1o9P2W/yBg21ksJpw= 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 225B96108E; 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-Rspamd-Queue-Id: 2F1CB40023 X-Rspam-User: X-Stat-Signature: jpejtbaxkdtwnqfg4mohgghd1xhzuj9p X-Rspamd-Server: rspam01 X-HE-Tag: 1688457622-332117 X-HE-Meta: U2FsdGVkX189Fw6TCEkDa+eTYqWgi1jlAOZvhNXTSVtbFqEMQhg3NohYVO4xsyVmniE0z3tRCse6tA8Bb7SH5twsv7v+4h72VrmNfQ0jwOUVYvcw55akm82B2RhnnQgso6Yve+9ayX2iEb0+F/T6k8kiQFcELr0DoYazL1dDMwElrpCZ8zCDwRQGRiZxkn4/ig8Gshq2K0KYGiUNYzBnT23d8TKpaZmuutppxrBg0c3vnjjGr24y0wIPoTI61jGy56+r5cNUV4he164MrT+mb6dvhb4QeyWGKJLtUPVRLvTWDXBEzCe8hJIlWtJNlPpgQMPMAy9HVvadipSZS/EqnKuEkcAWjF0rAwgFzGCMiHb2ttctk8yum3C91XSDS0w05EfHc4LbrkyPr69j8qnQ0OrJs0FBsIpgeXmC1kunZ2zncswq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povQS1lBBLa514nSbd0rsp4zj+Er6d7qqKhL5B+ZdrAARm9wB0L7kDnM+ictWbywgsG2abmNMUcs1+Umn X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 :)