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 122FBEB64D9 for ; Tue, 4 Jul 2023 20:23:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8BCF72800B5; Tue, 4 Jul 2023 16:23:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 86D072800B2; Tue, 4 Jul 2023 16:23:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 733F42800B5; Tue, 4 Jul 2023 16:23:08 -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 60F012800B2 for ; Tue, 4 Jul 2023 16:23:08 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 14D891A072D for ; Tue, 4 Jul 2023 20:23:08 +0000 (UTC) X-FDA: 80975053656.03.137AD46 Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) by imf29.hostedemail.com (Postfix) with ESMTP id 37D36120014 for ; Tue, 4 Jul 2023 20:23:06 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=jDLrG9hn; spf=pass (imf29.hostedemail.com: domain of surenb@google.com designates 209.85.128.169 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=1688502186; 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=9a6W0nI5dldeYBTATPhb2dlI8SAsLd6hrxr67cmhZ5Q=; b=4XfhwxQBVyUQu/eAHRR7IuX9KDOKWEjQmYav/2xbnn5BOXWM9tuJVNP/fIbIIvZkJ25Drk WIiNaCociAr0VFIfiyVipfxEE1TwWMEhAzoSl0rK7ohkioievvUSfMdnP+Dd9y05BECHov JC41r3cvHWpQHPAGA9plulzu/0L125E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688502186; a=rsa-sha256; cv=none; b=3EHY82WcyWX/dOWTHGP9bEZuTtoxUxAbuTYBbPxSH5CSk2t6viJK5Af0ma4u3uqSsPgEU/ RqsUipQ5YoTJmnN75LLzjWKkJRf6KsH/BnYmYcOLf1jSBXfIetmkBi+mw69gYM1NJ7XP+p hNBe+wUXcj2RND2Crp1Wr1IXmBZ0J5o= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=jDLrG9hn; spf=pass (imf29.hostedemail.com: domain of surenb@google.com designates 209.85.128.169 as permitted sender) smtp.mailfrom=surenb@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-5774335bb2aso53821357b3.0 for ; Tue, 04 Jul 2023 13:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1688502185; x=1691094185; 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=9a6W0nI5dldeYBTATPhb2dlI8SAsLd6hrxr67cmhZ5Q=; b=jDLrG9hng7j9RZclbFbYt97jBiLanCA13I7xQd6CkeRzUmalZDSbrdf2iqtWNylUD+ he7LFrNVAAX6/RsVaQATwUviDjceHMnTodzS8pJ56besYOvmt0sGvf+m9cp7F4zTWlXt 1Nn1uAaFkkZfVwf7W4qNBfyAxnoGb+K6dY8HXtuSq/IVryIoXxrHmTjbCF2HbLyMHC7t 4J2H/VpJMhQ8PJMc/WuW/F6iogspk3v0wJAJjiQgDB0mKQlhcKfx8F0JdjFAms9aqIHp jhfxwMNkFV5nkmLM2Lw/6uzJq+1LbrOFfoT8WnNAa0btOX0BFG3bnIdsuXWXo/yFNbvj gACw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688502185; x=1691094185; 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=9a6W0nI5dldeYBTATPhb2dlI8SAsLd6hrxr67cmhZ5Q=; b=RPTO1QLJo5JeDL4TGJSPOIVCAA+YceEBCRLJwMrm5IdoEwid3ff4+EGFWcZ7PwUxmK fB1NeITzGQNrL7elGV1xmtzy6Eoc8m6YItRzmmbzpVvRMDaIUcdF4LZUXcCrfuT3IqCS 5DpnWfR8AjJe1ur3a5InFuDYvHA4iMmhUAInX3MNaZryuk3V4BnYOzLglN/eOzOKhHeL KOLO3OEILTOmX6qfOD/gKaiL03PQTSEvZWUXOo11YU2AjXbbHUxnnOakR9r8p8Jb7U17 Bg4CAV5E4JkrO+zm7E2rzl5gM5d+knnX3ngeE6b/WJZbC01YARbg1MNSvLs+yabGASth TU0w== X-Gm-Message-State: ABy/qLaVKKHTxGsEWGEOeXBLuHVQSKILggigMA9+o7YWsobqi/ypMCAa xg+ZRj0mI73JsS0QPH+xSAmw44an9yqTSfVlNlYZTQ== X-Google-Smtp-Source: APBJJlFRxBYFIFi7jQMlJ9b0aiDIcQomVwZEpqQvAEHweseoYSsNoIUfOa0SIsLsBQ7oqNCMb6nS8RBbzB0YIz4DlUs= X-Received: by 2002:a81:8344:0:b0:56d:325c:442 with SMTP id t65-20020a818344000000b0056d325c0442mr12799162ywf.31.1688502185180; Tue, 04 Jul 2023 13:23:05 -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> In-Reply-To: <20230704091808.aa2ed3c11a5351d9bf217ac9@linux-foundation.org> From: Suren Baghdasaryan Date: Tue, 4 Jul 2023 13:22:54 -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: 37D36120014 X-Rspam-User: X-Stat-Signature: sj1uoqo9zrh8qtmpic4yen6ca4eutzxr X-Rspamd-Server: rspam03 X-HE-Tag: 1688502186-645461 X-HE-Meta: U2FsdGVkX1/5QdKOgTFdO4ee7aFstZeBFPEOr3UGRtG9P488lFoAnu1bcYZTBkfQpXaDuD/vwd8Ed2YKRwJlxZU0AzPSRpAhdcfRPfYbfY6NLkq31cXA+w5w6rg1uWlg0JcOclL//Mqj2IEnLSrY+GtkIoljHhXwS5vPLRUr8Jf+ChNu9zg9JGr0OuNv0vLM8NfIe1vtqlKj2o1t8DXjnD3mhhek12H0pyivmNmmm9ZG1Aci71tTmsqGPR3faFWx8OMXnvjmgOYhiuF/8GqyXnBsM1gEutAPAsiHMROeZOpQ3kfYFiTSkWY7RXkE+1cEilnTpeHUBDkxyeRHz0sBVdD93JxsYhebxe6j0AAMVsNrgkerGVei1xOnOSRyCSmO3EyAGcSTLGXFoKS7QnUXPPmpan9SG9ldC7YIF96vuvbTffLOZrwytJez35o/3gLJjcjrfW5WpBGAsfVGoLdhoCYLrYoElaG9wm6Ka4tZU18CHTwuckaqFAaRu8o3a3NLno/cTbSdzt9zNUKmZ/EghPrWZN9sKdETQiny/5iXvUFKuVGqf1XFFxWUbskz7v4Kz5g8RDqBipAhADdgFKobsZRIVkcReaDaFt4dWUV4esczoNzD49h+nKwACplnru2o57kCFAn2n/VlAm2QMACsIDmxdknihHz7B0r5z/+ugOt8VhNlZfIMR+B8iRVwNapzfbaH1f1M8ol3cfyh826CPpl59KUC6ihR/ss5MdlE1lPf40nWz1bqgyHPEP8koD73Uv5pTx2cnSe7hqTmQuAgjbVJxqyNuKmM/bnj3or9s7+P87JzqDOuVZjxsUYuhYuowuHJZ152l9dVuTfMVo+g1aEqe5BDwISCrKnQnXzZyVv6Nvy3tvu/bzu0lIydXkagpeB+9y4i1Wl7aZArex9w3VUxuWbJwUZUXuuyP3dBgiptZM0AY6bMVbv649/B3AlB1gBRBd6MpeWZkoZq5iE quGXtIVZ rubeDssGjC9AoVhwVSZLVEhD48atHx8RWmqfp8Q3vX4QDO+EXPVWqpsHT9r56QpE0z8gH7dtIkiWf5aUTwmDI3OstNec31mkRxNi/znqMpGLu7GgjHsb1ltpq3m/wzH0UR3IF+AT8Vkj9D1wl8UPw8lRIu7DmHPvT8YIIl7auN5x3TZUm0/OW0nt/rjbgxk3QHG12Z/g/5GYRq5cVWxWIRqh3YyhH8LfajlplhDEscPY8k/m+QcgSYPbHnBi6+HJpBUK/+6jx5IecwWwEiDl7OndedLGsMllN4W83Ff2uWMv6yhiiuz8X/UAjqIfMHQPQr4UKSxeXEjRH6LBFo/mJ1CSpV6tA3QyiufLvz4rwfU1G15Z9IPreNlukKUjnOOJ0fJOA5qdJbO7HVXVEXQMXCkxNSOh14+/W7Q+CCTvNgGsd/XNEmdi3s7CSgAAp2QX+VTD+wHOuoYbeWlmrZMxgHsQegNFtMn6Qqwda2ogcLQFWJs/2L3lmpt+ysAHsJhql0RseltMJZpJ1E5M= 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 9:18=E2=80=AFAM Andrew Morton wrote: > > On Tue, 4 Jul 2023 09:00:19 +0100 Greg KH wr= ote: > > > > > > > Thanks! I'll investigate this later today. After discussing wit= h > > > > > > 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-s= urenb@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 include= d > > there :) > > I'm in wait-a-few-days-mode on this. To see if we have a backportable > 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 slightly regress, therefore disabling per-VMA locks by default for now seems to be preferable even with this fix (see discussion at https://lore.kernel.org/all/54cd9ffb-8f4b-003f-c2d6-3b6b0d2cb7d9@google.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@google.com/ [2] https://lore.kernel.org/all/20230704200656.2526715-1-surenb@google.com/ >