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 7DEB2C001B3 for ; Mon, 3 Jul 2023 18:27:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 056F6280027; Mon, 3 Jul 2023 14:27:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 006A3280001; Mon, 3 Jul 2023 14:27:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E12B4280027; Mon, 3 Jul 2023 14:27:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id D027A280001 for ; Mon, 3 Jul 2023 14:27:33 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9E12B120834 for ; Mon, 3 Jul 2023 18:27:33 +0000 (UTC) X-FDA: 80971133586.06.8FC8BFC Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) by imf28.hostedemail.com (Postfix) with ESMTP id BD975C0024 for ; Mon, 3 Jul 2023 18:27:31 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=w1rSlYr2; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf28.hostedemail.com: domain of surenb@google.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688408851; 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=0isKEjHX7MEXue9Pz1Ccur/ZC63GmueF0VlBtGm8EoI=; b=uKTCzS9A/gTleFvuhFkCLmH2praTqugzD+Uk3gN/7juAD5gJORZoG4YLmoNMOTM6xkTViN OD0r2SDceCVBJA4dZCwzfOTuJ56dV4rciEGuZ5A5X4xb3HmCo85wdkZBCPsPiEHzFkqLm2 z/+glq3LzzKj5qxPZkFHN1BZFxE3U+I= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=w1rSlYr2; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf28.hostedemail.com: domain of surenb@google.com designates 209.85.219.179 as permitted sender) smtp.mailfrom=surenb@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688408851; a=rsa-sha256; cv=none; b=cwffsrySq/6d1/22eFN/ojbUqk2c4/KaR4G+dk/imKB0EGdasC4PKRPgm3TJB0S5xl/wY1 bQ0ndeaGz21ZXvpuj3A5N49drf6xpZcmVdIlXs1RL/VT6xm+n3GAFEd5aGO4DQeMrb/55T +DEGwVaA3ws3OZMMgD0nSVCSwUhBM1c= Received: by mail-yb1-f179.google.com with SMTP id 3f1490d57ef6-be49ca27e1fso5274141276.3 for ; Mon, 03 Jul 2023 11:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688408851; x=1691000851; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0isKEjHX7MEXue9Pz1Ccur/ZC63GmueF0VlBtGm8EoI=; b=w1rSlYr2bJam65DS0lPRCw3JfxRfPJVIeGkLawuH0QVACpcv1cEbmN3yS/9d9Jhd2y gWuA/6yRdVojMzVcjWIoMQnCRFrBdHsUCri4YQmwmCGqvmVgnRUjcImEV42CF9p2HNUt RNIJjoJMpBM8Yqs72KNbG+Q7Vclm2QBRCgMhwvmKmKBAHfyzQgGK9V+bBOc5xngTKVY+ R4t792TUWP12OJYQgjh6dTgC1nO4V6mOoZVzPzmVhbvkDRUxjx7H8hIFK+KllI/p1SSS NKySvyUZum+exg7sN4tpowuv7DwRGfJ+F1AbKfbFzZFthr0ez+mTc3XlVxhYkdNO0qgi O3+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688408851; x=1691000851; h=content-transfer-encoding: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=0isKEjHX7MEXue9Pz1Ccur/ZC63GmueF0VlBtGm8EoI=; b=Y6pImFJrshxK4esDWrysJxQ4Vd7mX1vgbK6NO8mJxhuPPe91jC0bi9v0ix4FNXsL9c rrK1CWIawxIvGmT6V9I+flZ3P+avVIAoCS8QpcfamE0WtR3CTcn3fTDbcjSzh3EkyA9b wZxs4K+FHaHCtrOKRu+21bapZfxIEgjYmjdL6tTZRSICwW1RnWGhq5xRS2R/jGilt0WM 8WalL773nkqmQDjFljI1f7mrjV6V60RtiK2LVQROkTzgc1NDRlR5Vyh54RuTxpN7TAn+ svJJLhVKZwaUk2PWqJd6EoWBCQEEaE4uRgvBYthowNJXxh5VN3W2RwVY8uDaj8P4H6iK pkqw== X-Gm-Message-State: ABy/qLYuSV8IghXKSPGB62NQJg2dg81CRbpn6MKplD3xFZlb/1DRwc6Z FKLZXRMpSHq+FUYBPp714nf1seo1zlgvROGNTcpBHg== X-Google-Smtp-Source: APBJJlEcsiSJampqWvnjg3CAmKUIwmDnEsqWjNRvFLw+nAO0EpYIPr1eboqaZF2mndFRhRVNL+SZzDgLqiS3KzAbWO4= X-Received: by 2002:a05:6902:603:b0:c40:e589:7c09 with SMTP id d3-20020a056902060300b00c40e5897c09mr9113458ybt.26.1688408850615; Mon, 03 Jul 2023 11:27:30 -0700 (PDT) MIME-Version: 1.0 References: <5c7455db-4ed8-b54f-e2d5-d2811908123d@leemhuis.info> In-Reply-To: From: Suren Baghdasaryan Date: Mon, 3 Jul 2023 11:27:19 -0700 Message-ID: Subject: Re: Fwd: Memory corruption in multithreaded user space program while calling fork To: Linux regressions mailing list Cc: Bagas Sanjaya , Andrew Morton , Jacob Young , Laurent Dufour , Linux Kernel Mailing List , Linux Memory Management , Linux PowerPC , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: BD975C0024 X-Stat-Signature: i8ghjpbzi7cj54q8sj65c6tjqftdjb4r X-Rspam-User: X-HE-Tag: 1688408851-374406 X-HE-Meta: U2FsdGVkX18Mh42TvczvsatIChFCuHpPETzzpb4TGU/JsyDcwSSVm9IBF8OZcazTB91D/5JUzmbm+GVUWbex8I08q3WBD8PK2fMwqF04+SVJqaUsz1MXsSLFy+Cp4gISPQA7oAugLweCl+fqOeDNLJb+KWto6G1ReLOx9j5OfIrxKc2/ARo+q4DVz+0wrmRICA2S3IhMpQg4VtuV7tCpc34m24yP3W5eXZG+XqmT/Iecgc2tA/JsFe4wDkpZ1OiQTEmpuVoN9j7pBsoJKFlOVvTF7nO938rju0yHL2BiGKPQVaSYppiA+sTkXHiwffoBtUp/eC9+mFnMS2BQa3BeT8gN5JaPZStRFyg4aN2/EEPvQzhzWU5bkumRjiQY6gO+qGKhbVKmtWNXJ2ctjA6a9uIKQO/5yXTswBg0NLcc+j/Ekoy3EDle3ywVBIw++dcmR+LRxmIEsz0evjBGmz2dOavWb/o6k+neofJj0jsAELW5hlEVC0t5MDI6GRVufrjC0m7D+CXRThqMSj7fymxOtyvkLusC6FoGvV6cOcc5cRZNnUVNeYnaDruUaYRsy62eS6ikzX1Xh60a/kDg+Wq1TplGhrYLkSvM8CiNAw57SWZ6UHxndlheAuVlmEZ/S4cAafxy6bpF4YAPNKShL1LmCCluolxY83WRdQjqMD8dweNOJIfX6f5wuKo/vpNARUluEQor194d6u+W2440kNy9zmzA/OOCJI4wL9GOP53m/E5HEP3K0h32eYp0eHfkC6z7CP/LkwCJ5M7CFRaevbQUqBkmDXi2RIG9AxWJ0dEkg7wLcW3hTRcevLv/nrzpDjDuNLzdJa7hG85jrLBha2nV5M5SinL4G7wyjxecwBreAtmOh2bU0LLo7dWzmqmVQXyQ7zWWfM6o4CGRGg/rIsKyEnjBpEjVII3SpD7yI2bbRCppR5UOtPj8l4moNFHZmBkEWKSsWl8Skw7tn1jhwx6 5Ed0Lphn RDl5g0bxeaFU9K+K1Tyge9Ggpc+S/sHnjsDO/6TeHpT/ai6pGwXbTCgN4EMoFhXyfbIld7sPa6z9uuiVQt3qc12diWPXSDshI2fcvli3PH5P2cBnq22Cq079fjUuItHuq81gwcjb2uIpHSW6ZQNoCbDHkiB0NkUKJsAyotbo6748r1DJgEflF9u6HMP/fCRCS78moW/FFGe+skMBLuzigYoGJJNE6FEVRLB4T1PiK6Qz3Wj8bijvTFj0/+ozUz+s+1Wo8HLDLP3ZJnDJmSrq7kJPGXAfPqGRouyl5ZgyPxKVxsm0H770xAgx4ScxwCStm57NsFB+GJ0wrJFm90C4lWkyf8PMBSZI0z72C9fysqewKRwMsII3LjBxqja5jMoODuJ5yqublgpvcALP0KaZ37yp9jJeOQ//rqy3GrA1kGgPC3pAXd2EFVDuqDc8sNyB0LL8AuRe7IdzTi5CQ7c+N3qlYSBxxwIPWhz7b4xNwUNC3e4s= 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 Mon, Jul 3, 2023 at 11:08=E2=80=AFAM Suren Baghdasaryan wrote: > > On Mon, Jul 3, 2023 at 2:53=E2=80=AFAM Linux regression tracking (Thorste= n > 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 freque= nt 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, wh= ich indicates that memory corruption was detected, occurs approximately 99%= of the time. Exit code 1, which occurs approximately 1% of the time, mean= s it ran out of statically-allocated memory before reproducing the issue, a= nd 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 bi= section: > > > [...] > > > > > > See Bugzilla for the full thread. > > > > Additional details from > > https://bugzilla.kernel.org/show_bug.cgi?id=3D217624#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 C= Ced]] > > > > 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@goog= le.com/ > > > > > Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat= ) > > -- > > Everything you wanna know about Linux kernel regression tracking: > > https://linux-regtracking.leemhuis.info/about/#tldr > > If I did something stupid, please tell me, as explained on that page. > > > > #regzbot introduced: 0bff0aaea03e2a3