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 CFC81C3063F for ; Mon, 3 Jul 2023 18:08:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F1F8280023; Mon, 3 Jul 2023 14:08:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4A141280001; Mon, 3 Jul 2023 14:08:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 36881280023; Mon, 3 Jul 2023 14:08:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 27960280001 for ; Mon, 3 Jul 2023 14:08:48 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C4F98AF74E for ; Mon, 3 Jul 2023 18:08:47 +0000 (UTC) X-FDA: 80971086294.19.2F6D5E6 Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) by imf27.hostedemail.com (Postfix) with ESMTP id CA3D94000E for ; Mon, 3 Jul 2023 18:08:45 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=35oM3+4s; spf=pass (imf27.hostedemail.com: domain of surenb@google.com designates 209.85.219.173 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688407725; 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=TjP+t63cmXLZ73zOjZVRIKi8PaFjf6acXyVJzs/mz5o=; b=N5Rszt9st3kMX9/kl4QnBCJ11bWIkZXrdO6oDKrwDoqry+uAeAyX41dBrJ6Lbqjbf0EDWn D9ESRanYYcUcGun3Hma/j2b50eNQPMiV5fOC89csO7ccRN7OgzDhhe3NFyzDQRX9NFqx7O 2i6cD+fR2zKTg5cqjKobL3SjSskIWqc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688407725; a=rsa-sha256; cv=none; b=0UpXxZU4DMPvKlKvXV8I3jREoQNSH8JkLbX5zY48dagCK1mClTysKDMG2Ctg28tGGMLkrq d6iSGUGgdmcWNhRz5vZuHtr5JVr9k8Q0yFzz3jkkxPR2BZ1HkXPS5MJ8fCYlhiagLOltU0 wFGTFiJjXqIGwqZMWC6Bw3GSEonsTNk= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=35oM3+4s; spf=pass (imf27.hostedemail.com: domain of surenb@google.com designates 209.85.219.173 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yb1-f173.google.com with SMTP id 3f1490d57ef6-bad0c4f6f50so6948181276.1 for ; Mon, 03 Jul 2023 11:08:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688407725; x=1690999725; 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=TjP+t63cmXLZ73zOjZVRIKi8PaFjf6acXyVJzs/mz5o=; b=35oM3+4s76Gmu0eP07vWHgS6Rk1tmz7OxtUeUPJT2hC5YGbhWy3+elQhg6NwyPjOgC M5zGqi2lKBWN4PdxjaMCXIIyyVAmd+jOB8Cyi2Ra59jlhyS1r2WxTzJaGA+WlAFGKg7x UAN6LJSmzeDRQvjEALRuAl699XjFjFLbfZ4vVLR5K+3GGUenIRNYaJhyQ0g/oQuHu6jN 7b7Io6rtkhGFBOyeFVv0UpwjuK3CM3KJZFW5M0FVXmWcD6eRcW0JbeDlDssgckP6Ht3O ygvptCGOnz2qiBH7Wb7KL+uCmr3fzfEIK0VI707ZQLPwzcjlupIU/DlzVVNDLPHuwFkt z/Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688407725; x=1690999725; 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=TjP+t63cmXLZ73zOjZVRIKi8PaFjf6acXyVJzs/mz5o=; b=R2hOJngGduQwRD/jEUimGoKutpMroow2y8Y3J3ToHsJXL2pohLaxI0MvSaR9Zlhskj fhcxbXhnuaaDKgcAmurtlrNycgbXniGy9OWRd4GyB0y9TjkMOYs/1FBPDM+u+c3yhvDN KluBprP+mu2DesvlDdREduH0kn6LbyBoJu1lKdUY9gPHTjuW30/u1dNvD4bpxGWNgm/f yQpQNRo2J68ZEgOb4dzSJjZeWE/0Y+S3Upd7K0/ch0n4l5fAUJPcuJcBchLv/49tR1DS NrNMXtYacBkDaUIzgNDerCEKPbRppWUESTVhpOJ+HhaAo9uOFe8fQ43IlJAzyW4jJXbP QwGg== X-Gm-Message-State: ABy/qLZLIl0NxCliHpN8wzSPC6HDWZCoqRs5ooMZtLHIe6n5+6zD27Ms pHB2gkc86R3ccxYQV/sqN9I0e3I3N9vtRlfzu8wbaA== X-Google-Smtp-Source: APBJJlHqFAXrJx6IysDJ2T6WOUSv+vPO3CrUXTDQ+klQimcwHP1PCpSvjaq7m7khAiRcDXbb9/iNwUyOESsL1qgRn9o= X-Received: by 2002:a25:1003:0:b0:c3a:8530:c8a9 with SMTP id 3-20020a251003000000b00c3a8530c8a9mr12592615ybq.11.1688407724626; Mon, 03 Jul 2023 11:08:44 -0700 (PDT) MIME-Version: 1.0 References: <5c7455db-4ed8-b54f-e2d5-d2811908123d@leemhuis.info> In-Reply-To: <5c7455db-4ed8-b54f-e2d5-d2811908123d@leemhuis.info> From: Suren Baghdasaryan Date: Mon, 3 Jul 2023 11:08:33 -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-Queue-Id: CA3D94000E X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: kgxymhghuaj764imh868qjorp1dsnyob X-HE-Tag: 1688407725-3735 X-HE-Meta: U2FsdGVkX1+s26c4uBT4U6aVcrPs//qWOkZv50ON8tAwKtApGTc3uDZlXT5FeZmeya1TMuvX6Xecyixi9E2NJD5m1LBpLS8Ne3F3heZr0BEIUnhHYPBkp1DkuZyCqP2i8ZkfqxIJiyxI8VGUHThJhrqYeGwXVH+cDM4DXKylkY7DeNc8HEJgnJLqbgyRAmvaOv4uuXnJFpKr28WywH/i/VYVxDhM+k2QzgBKdnCesj+T5xvjDrP7fddW0jRbUzF1PCKyoSb8n2YeY7NySYy+7JvF/4DBxKkpczGEu5AEYBwG7oXcPria7eHkogyP7X0Ei5SNZuJGibDBG8IYRV1e5zbrjMn1W/OFjfDFH75WfyD1jnNHSpJVwdGXyzPgPavJxyZlr7UjLlFHK2GzpoozjP/Q0MaPZecvsTmDOjcHsGzc33IL1y53yc6Mw3FHyzfxuGY3c7GSV7rj/1mNVuVABZVEf6yFfQC9PTCQ27dj0/sFul8JKHYQEUfP+Rven7QRsIzDR0OYWCB56caRqh/t94XVBl+HE/xHhbwyQEdeKqJS0Ejjk4/45Eu22tg9RtUVet07oB7e8mymSJegH/r6TWTswgVNiCynvEIxKYQ4Amgmw4XbltDBOGuk6qnSXwPHhruN/U11G8wNipCNQq1unX21KU6pMZ8yTBIsFYT1e4eWdSqI+p6tqCUWSw81Z7Z6poxy9JRadsmQPgXs60FT7odEaVRosDR4kgw8MKC2Hb4FbB8O4GxBFdu/+ZYXlprTM4C5K2nHsYOAVNXUKrzleKRWCqq16BHl/VNmu76WS5IWxcYbMKEYa2Y9hiWnpXzaYds82HsKTh8VPyMJTkp88JExZAVLxTtSENdrEGKbmlW5Thss/ejWqw+NZSHfbQctGAwf2E3MORR3QO9MUDaq8avZDdfIqI7pERjFD3rH/Hhyz0EVbwaG0zlO0iXnUK8SLlZmTtakjaj6obPh5yG OBr1SWUQ CzqXa+VXS1q1/BPVH/tLFTbVfZIW1niA0HW/2AIIZ3VfqSc/I4iCW7ajSg5fQPIwaYBxwY0D+uJeminLvAaUK1A9R9mJjZkGgboQUfktgjgu1y6BSZweHuUUamWqncSwm3wEZ+Elrv3tx0C0gzvO0b66zu4UaUZkCtTRoa2bz3mV2JJAWdBIy4uAW9cRGP0vfEeJLT5aE3sREdHHI//4bZJetgSaA1eYDwKLWRxNZYtVCkSsl0H9dO0G1Asf/O4sXJQZzf86S1oF3RgmVif/k+Ltyk/UREPikZ0UJ/O4/DElqb60yGq0rk07R7KfJMJQ2DWlh9MiJI4nL4sHEOzNQOklIvDoat5WLDFmQRpBaQ+DMdCzavTIJrKzVM2oki1uwXtRtzLSwwyUoYMDRMUZq59toR6yvavZ1xzyxX7WEQ80/ZFAyQEX6d581Rd2L9AC9weeA 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 2:53=E2=80=AFAM 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 h= ave come up with the following reproducer program: > > [...] > >> After tuning the various parameters for my computer, exit code 2, whic= h indicates that memory corruption was detected, occurs approximately 99% o= f 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. T= here is also something like a 0.1% chance that it segfaults due to memory c= orruption elsewhere than in the statically-allocated buffer. > >> > >> With this reproducer in hand, I was able to perform the following bise= ction: > > [...] > > > > 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 CCe= d]] > > That's the same commit that causes build problems with go: > > https://lore.kernel.org/all/dbdef34c-3a07-5951-e1ae-e9c6e3cdf51b@kernel.o= rg/ 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. > > 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