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 04976EB64DD for ; Wed, 5 Jul 2023 06:49:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 959CD8D0001; Wed, 5 Jul 2023 02:49:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B9926B0072; Wed, 5 Jul 2023 02:49:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 733018D0001; Wed, 5 Jul 2023 02:49:11 -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 5C30E6B0071 for ; Wed, 5 Jul 2023 02:49:11 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 10B73C04F3 for ; Wed, 5 Jul 2023 06:49:11 +0000 (UTC) X-FDA: 80976631302.18.969C647 Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) by imf03.hostedemail.com (Postfix) with ESMTP id 4C33E20013 for ; Wed, 5 Jul 2023 06:49:09 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="nl1+iD/q"; spf=pass (imf03.hostedemail.com: domain of surenb@google.com designates 209.85.160.48 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=1688539749; 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=RKSBJo7irT0I1bKzFBpDIxHtHbxTle2uX3bUt2F2nbk=; b=NsMaj/M0AINtDL/9wZ+W5W4ch5LAyaKAf0PIwnYAOQ7mQItn50e4JQlWZj1vZiEX96zOJY +lM/HbHhaM9m4nCwOyowjyXkZJ2WiZ3/ZqGMkHzEFJsIutARPlVTpAL1XX54z3JBPy7AGd hKDf3YiNuDpcpoIXj041rvX4jVkQf7k= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="nl1+iD/q"; spf=pass (imf03.hostedemail.com: domain of surenb@google.com designates 209.85.160.48 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688539749; a=rsa-sha256; cv=none; b=0CqnBRfCPrHzwCsMI7/18tWixt1UXezkWbIjM5IFwHQeVu3S9hSv1pdXWRt+pjWcXfuGIr LBPbpvnLvWQs+Rvkht1EgTOHEwHVp+GCJ+dF1ho9k3uy4ViDbL7pmYbuiSmf87xK/SeN8h rb97dVPLh/rrz2FORhxop+rkIylffQk= Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-1b0156a1c4bso4168583fac.1 for ; Tue, 04 Jul 2023 23:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688539748; x=1691131748; 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=RKSBJo7irT0I1bKzFBpDIxHtHbxTle2uX3bUt2F2nbk=; b=nl1+iD/qtH9zX5BSQdLtOc29VoSgdcwB0tzGd1bFOqKM/jiCY2QNtjaV9dGg2RxGQ4 UoJoIQ+rs91qFOGch0Xd+J7qNBvuxUCrIAyFC8s0RgYpoLy8FFi3wLUAfBgYZKy6YKS5 QkLUcZq5J26sV/ZFJZok7kCrQqqaFrq0R2Eeqwb2WvibvqPCGB+pF6pDEI+N+PubM0bg 6HT+T9cQVXVxi+bT/MErCCoziBbimUhK1DVeZ6s96PxKDQJM0ZCzp/LZlMjehgLFO1BR ZbR6HKAb7qk8mkXsvRT2QjQNZmoGuWGrjrPaqYeJmOcsWjxBRkJmBDNRaX8tBTOB44BN k+7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688539748; x=1691131748; 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=RKSBJo7irT0I1bKzFBpDIxHtHbxTle2uX3bUt2F2nbk=; b=L3kMy4Fklap8okyAyfvujmZRX+rZxMsPt6V+TT+nzVFJY6EHNT61UOODlYCZgACvm5 Z7a6BKm1V0uxUbAECBU3Uxb0V9IkAbHSy/uDkZ7kHtUeY8fw0GMW/xeJxTY5pma+A9is b2MKksfH+yYMMVsmSYYW6VJufgedPE0/KIErFJcw5b09/yce0VJOYmcGUbkEpxki22kg QCmQiaxL3nPyEzBvPhivWVcGIdzuc8F/id4nNCY9t99Zv9GpJ7qpHrRBt6hRYr6oPeHW mgBGm56HyCNzaclSoraWnG9VhmYpf+4c7w+p0G1jmJC0ut5+ep0M86mMPhTv3Bq7qcJ7 XB0g== X-Gm-Message-State: ABy/qLYQshFrXbXaqTzy97tLWvgiXL0jXDBVaJLx/m4y0w8HiqSZxFSi EeOT9RaBohPstNFmm3nMoqOPekkpUxTJhEnutZiVga3Y1pAQH1LPIdURAA== X-Google-Smtp-Source: APBJJlHAWgde7m2RXt1Ev1tbVGxPLjTAl4oWP3/x/U5RMysDIAF74aeukOVtDnUyOkuuv1arhWie5Ne6KoGdiAfYUAI= X-Received: by 2002:a0d:d9c3:0:b0:56f:fa56:4c32 with SMTP id b186-20020a0dd9c3000000b0056ffa564c32mr10994044ywe.52.1688539350394; Tue, 04 Jul 2023 23:42:30 -0700 (PDT) MIME-Version: 1.0 References: <5c7455db-4ed8-b54f-e2d5-d2811908123d@leemhuis.info> <2023070359-evasive-regroup-f3b8@gregkh> <2023070453-plod-swipe-cfbf@gregkh> <20230704091808.aa2ed3c11a5351d9bf217ac9@linux-foundation.org> <20230704142846.524daa14ff921ed7eb534594@linux-foundation.org> In-Reply-To: From: Suren Baghdasaryan Date: Tue, 4 Jul 2023 23:42:19 -0700 Message-ID: Subject: Re: Fwd: Memory corruption in multithreaded user space program while calling fork To: Andrew Morton Cc: Greg KH , Linux regressions mailing list , Bagas Sanjaya , 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: 4C33E20013 X-Rspam-User: X-Stat-Signature: ss4utwyrz3sxcdr4zby84cthk3w86uad X-Rspamd-Server: rspam01 X-HE-Tag: 1688539749-930894 X-HE-Meta: U2FsdGVkX1/QCiRs+9oduhR+VwuJhAMTpNxQvbvo8u0B2N9rhft5o2ilmL2b4tvYnCt3bb9KkKy7lNL+o5zEcFkHTNz4Pujpg+qXeUoDCpM8DPmliU5At+vtdP5L+tdr/ZDLcDXu0MEewdWC5tDon1TXp18O5ZS+cgaL86E4p1ihC+FtjEFRpAJDEjaS7F3Hpoz+gsy0v+yUhP0WuoFCvFKLqgMVTc0Q4ntlPmvQgPDe+JN9RQ+3eL//ja2RUciC+/GcCCW0MsjLDmbqzkew7NcRT+iKPORwesnL1twKoL4uIF8qMnXuHkjk0GrERDMbF/ajl+0rFqFiOTGKAIbuRJw+y2I7BEGBMPm2+u6dE7yVyeZM44O3DFSL2ebOOrXu/0X6Ns/Ozv08PQIKto3A21U0r5/kSMpODP32gLfRZ7talunCGOV7mI0j7wfvSwjlRqVKmeofIXmd9LjZVD8+xCpUGQDeCP6FcMiSVaBtz9IRl8bZ0d4900IKKtvTqZqY2Zzed/8hmNpczM8UZNmIFYAe2jbrm8JLVaHvc6ZsxxEbvjL604V3S0aR3rUys1gZNhiQ0FVkOWwh9Gcds1Gwu/abFDNYnd68qlTpUcjga1O18+M5nzgF42DCUMM980zUnN24M8C+aIuQGhm6lT9ANQeBRMJExrG3zVuBy83ftKB+lCeiNxQ171fxyNBzucuqzWhJqyvIUOfsEzVw+afJZUZbI7nuoYtjPQyKUcTQ2fn2yweAN9atLetZGUwrxBvLItwPkccF1JKl/ig7231d3/zQxGLQ3esAUKvvcng1ni29zBSKCf1AX8ecMVGq0p75S7/DeHyApEg+uciSojTQUdahjdeWcqrAbyRLYJ/Cyw95LHH3RgKbB/eMKIj+QtyWV5f/7o1jhHMEH97V+QOQSL5017feUEZhY0Nvv6AktS9LL8RPgmE6asteL1cv45TchGxJk7Pq7XPahn2Jf2M AaAkoDJn /zl8QUCNt2VIaeoLP7lHdc67J4MiO3aDpxeJrh+j48HpoNKvergloF1ANyCYAkVJjR5hjrpgiV92quUg5ZymXJxFpTPGMvUdJAkP4slbpcy3GZeEgyPKxGF4O5NZCMnNeLcOv0Af1RMYkkwVTjHeQs/nWDkQHTP6jeDDqAfuSwn1lQLfpLFwToZB4RhgIb9MzPm2Ztgxe7MIVibPgvswSFXt/pNzrAfkUROoeyxTDtF+dq8f3k9vOExp/c4gSTjaTWbCtNd/PzDHq6SQLOyxLwbM8nC9B++DgkebriAG/RhkPqUSuzLNSIaKZMRYHTJHJNMW3hf5ZQ9eVxyY9kcMwZ6O7mGxKB5VuSHok7EU/GNw2L3quqQEB9baDq+X3u4ijQ5JNNooZwMXLCENagcnw1PM2EiNPKs2pyAysqOkkNWW5JDU0F45pvIjh1h1JogjPpXE9e9QmuCI+elhKheSuW9ReRlOGygkVtn1zFv+fXERqnCFSlYSoiZNR4KI7wLwopaZVNCbIaQ7hMrA= 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 4, 2023 at 3:04=E2=80=AFPM Suren Baghdasaryan wrote: > > On Tue, Jul 4, 2023 at 2:28=E2=80=AFPM Andrew Morton wrote: > > > > On Tue, 4 Jul 2023 13:22:54 -0700 Suren Baghdasaryan wrote: > > > > > On Tue, Jul 4, 2023 at 9:18=E2=80=AFAM Andrew Morton wrote: > > > > > > > > On Tue, 4 Jul 2023 09:00:19 +0100 Greg KH wrote: > > > > > > > > > > > > > Thanks! I'll investigate this later today. After discussi= ng with > > > > > > > > > Andrew, we would like to disable CONFIG_PER_VMA_LOCK by d= efault until > > > > > > > > > the issue is fixed. I'll post a patch shortly. > > > > > > > > > > > > > > > > Posted at: https://lore.kernel.org/all/20230703182150.21935= 78-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 olde= r > > > > > > versions. Did I miss something? > > > > > > > > > > 6.4.y is a stable kernel tree right now, so yes, it needs to be i= ncluded > > > > > there :) > > > > > > > > I'm in wait-a-few-days-mode on this. To see if we have a backporta= ble > > > > fix rather than disabling the feature in -stable. > > > > > > Ok, I think we have a fix posted at [2] and it's cleanly applies to > > > 6.4.y stable branch as well. However fork() performance might slightl= y > > > regress, therefore disabling per-VMA locks by default for now seems t= o > > > be preferable even with this fix (see discussion at > > > https://lore.kernel.org/all/54cd9ffb-8f4b-003f-c2d6-3b6b0d2cb7d9@goog= le.com/). > > > IOW, both [1] and [2] should be applied to 6.4.y stable. Both apply > > > cleanly and I CC'ed stable on [2]. Greg, should I send [1] separately > > > to stable@vger? > > > > > > [1] https://lore.kernel.org/all/20230703182150.2193578-1-surenb@googl= e.com/ > > > > This one isn't sufficient for .configs which already have > > PER_VMA_LOCK=3Dy. Using `depends on BROKEN' would be better. > > > > > [2] https://lore.kernel.org/all/20230704200656.2526715-1-surenb@googl= e.com/ > > > > > > > We're still awaiting tester input on this? > > Yeah, and it seems to be negative... Anyway, I'll post a dependency on BR= OKEN. I posted the patchset at https://lore.kernel.org/all/20230705063711.2670599-1-surenb@google.com/ CC'ing stable@vger with the cover letter explaining the situation. The negative report might have been a fluke, so let's wait for more testing. In the meantime we can disable the feature by applying the last patch in that series. > > > > > I think a clean new fully-changelogged two-patch series would be the > > best way to handle this. Please ensure that the [0/2] intro clearly > > explains what we're proposing here, and why. Done. > > > > Also, "might slightly regress" is a bit weak. These things are > > measurable, no? Because a better solution would be to fix 6.4.x and > > mainline and leave it at that. They are measurable and they were included in the fix I posted. I added the numbers in the new cover letter as well. Thanks, Suren. > >