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 78D8CC001DD for ; Mon, 3 Jul 2023 18:44:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 028EF28002D; Mon, 3 Jul 2023 14:44:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F1B03280001; Mon, 3 Jul 2023 14:44:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE24628002D; Mon, 3 Jul 2023 14:44:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id CE72C280001 for ; Mon, 3 Jul 2023 14:44:23 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 79DA68097B for ; Mon, 3 Jul 2023 18:44:23 +0000 (UTC) X-FDA: 80971176006.22.A9D8E57 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf23.hostedemail.com (Postfix) with ESMTP id 29895140014 for ; Mon, 3 Jul 2023 18:44:20 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=Z7K9Fath; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf23.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688409861; 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=R1bYh5Wx3oBVSCkBg6aOfP0avtCPu0AKZX4ReUIgDQk=; b=usWRD/HnTN0uUZw7p/InKFK4oNF5VSIwZFli6HHm3b51DUGnYg7hdmGcRzsu6SCrP1zrzy 6vHtGd3+4Y9De90q1zAzIMxllk6m8E5wftiO6dL6B5UBdrQnr2+5W8MlyIi31aQdztv5KV BbkTuNiX8ayqzw6qPPZanazWOduh+eQ= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=Z7K9Fath; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf23.hostedemail.com: domain of gregkh@linuxfoundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688409861; a=rsa-sha256; cv=none; b=Gqg687k3QCCtz6m/kB8aDxrDClwzjH+HULSyisAvRlGqPC1sbhE263mJ/aUywe5ofnOAam Iov9AVmihr5UB1LzzRN1WMS2gP2UV/UDlS6ZtimIIbcyC50a3qVBbB1bGXIxS4NhJo5LJ4 fHTCWdgzHRIO3skLzDYzvHV5ZBAn+q0= 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 A99D16100B; Mon, 3 Jul 2023 18:44:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0D2AC433C7; Mon, 3 Jul 2023 18:44:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1688409860; bh=2uAqICqoHfr9JtNMBA+xJ3OMXBg414ERFpRhYQggwas=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z7K9FathaHPI6/wxy5SOzbw+Mn3X/luBzM657rDx4HJNm/6VjummZyAFF/3sfzVYF LxMRVIqsVH39SZ+5khv50NT8+BLJktP3dug43pWtYN8QAKJhSueo7i4IHOa7osISsg 6L983hQun2qcLOjWngQMIZXxjvWbVIiOoK+4uq0w= Date: Mon, 3 Jul 2023 20:44:17 +0200 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: <2023070359-evasive-regroup-f3b8@gregkh> References: <5c7455db-4ed8-b54f-e2d5-d2811908123d@leemhuis.info> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspam-User: X-Stat-Signature: eddo6atygnx15qx8m3o1n1xs9tu8awuz X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 29895140014 X-HE-Tag: 1688409860-659324 X-HE-Meta: U2FsdGVkX19f1wNvxj3PmmCgF12VM2lQJQiLPxDyomDHUPoWec+4ZkONSA9PZ78y7Kcc+6PNQAMVJBRLG6L5VSLVq0AKZgvJVx4UsFZKkn/pxiKdGHMLE6PskKB6SvvW66TxQfm14sGpf9K/62cGxRA3cJmSIyX/97l+66UTfn/mGJAwSjBdptvi50eb5HvdqryQKoHTEHnQ++YkJTVyoulx1NfhZpq/xeWBcgnQQBJE2WrLEetyPCHKewWB+2qw+lFnnxkj+g25Pt+oETY0ICtoWE9eTnXALXhOqJrEokrzeY9uXVUIuGROWAFgguilSXfg/p0+78g3qa1DjAtuWL6CfeybJoen3lSEXN+SYTNqqbuF7aI99QYteQPjZK5xgyKr0iCXypqtnqFkjBmELJ+ox/shmleXIGO/JS8YlG3fVYfY35NsMLainrpJ2MWIbT8xX9k4JrRpdruhbfOac1ApXZr0LhBhtGdNh6qzW4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2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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? thanks, greg k-h