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 X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0695C47420 for ; Fri, 2 Oct 2020 01:24:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 637F820878 for ; Fri, 2 Oct 2020 01:24:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="phnG+o1k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387536AbgJBBYD (ORCPT ); Thu, 1 Oct 2020 21:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727780AbgJBBYC (ORCPT ); Thu, 1 Oct 2020 21:24:02 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 702B5C0613D0 for ; Thu, 1 Oct 2020 18:24:00 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id md26so524438ejb.10 for ; Thu, 01 Oct 2020 18:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:mime-version:date:message-id:subject:to:cc; bh=ZuhbLiKiM/JcAkw5V2qrfXh3m4GeTtm0DV+AllcZcTo=; b=phnG+o1kyRsRwF9i0GexiGaNbZOP24P5O4ULQ5ExpA//VqilVb567sh0HefGxeA8xg nMG3wUlLYwDwz4ju0m6VjavsnNxCh5MJxDO+LJyeqWjOILRr8M1KBstrnZUQ1H7jEgaG V7tVvRw8Fx6gNANGF4V4dkqKva+5oIleHhh3HEfSVIeDZjy9uS09Ntv7j0ce+RhBTF1Q uNwPxns7ceb7L4mDxU8VbGuG7YWdhfiiSKigxqQF5GocQsOaAujd0SYo9X38CLWdA9V6 2OGNFwDeurCJMAYhq9WaWDC678AEwJyWPQELa8jAOn4Wl6+AxVScu4594E9io4FCn4g1 4itA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to:cc; bh=ZuhbLiKiM/JcAkw5V2qrfXh3m4GeTtm0DV+AllcZcTo=; b=XbTsC2PJWuHPWziUPXeeOepwv6ttCSd1zc1azCCbkzDzBMqwDlqg8o/TZPZScrbRzm 6Wa1rrcnP1leX/Xe1sWoCETY0S3nhMRk1jb+g2qop9BD5duDHJZtNrmMtxoq9F6pjuki IaQg5gxKvdIVoorzpPT+46g0QvwmVdHOe6DaHid34mR0laQor3dI6dSONXOIqTuhP32G hf7A5lik3jEs4kGCeoxF+9VLbrIBDvJABGbQKvssy/E0slJoMv6HUXRfEdWhpI1eDx4l NmuUao3YuUwDJ1+ggC9SbXfP1k6R0Gkj4LE7An0bsM90ghLFvMQFTKNXMVmgPXPkxOKr 3LYQ== X-Gm-Message-State: AOAM5336utch7H+to0WejQ+Y8b1/UczFzHKYFFa0YJoG+VhiFyflLf79 bCY2Gsda4Q5CR8qbjAoUQEYM5JllSFnhj97zcAZiyQ== X-Google-Smtp-Source: ABdhPJw5ERWukkY+5ZDguQiFbaiYeqNOoiZ2ZEg/InHvYl6Vbjj5rB8NrevRCvjERC75sEP74nGnWjbbHtYkIX1mGeo= X-Received: by 2002:a17:906:33c8:: with SMTP id w8mr6469076eja.233.1601601838935; Thu, 01 Oct 2020 18:23:58 -0700 (PDT) Received: from 913411032810 named unknown by gmailapi.google.com with HTTPREST; Thu, 1 Oct 2020 21:23:58 -0400 From: Jann Horn X-Mailer: git-send-email 2.28.0.806.g8561365e88-goog MIME-Version: 1.0 Date: Thu, 1 Oct 2020 21:23:58 -0400 Message-ID: Subject: [PATCH 0/2] Broad write-locking of nascent mm in execve To: Andrew Morton , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, "Eric W . Biederman" , Michel Lespinasse , Mauro Carvalho Chehab , Sakari Ailus , Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Jason Gunthorpe , John Hubbard Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These two patches replace "mmap locking API: don't check locking if the mm isn't live yet"[1], which is currently in the mmotm tree, and should be placed in the same spot where the old patch was. While I originally said that this would be an alternative patch (meaning that the existing patch would have worked just as well), the new patches actually address an additional issue that the old patch missed (bprm->vma is used after the switch to the new mm). I have boot-tested these patches on x64-64 (with lockdep) and !MMU arm (the latter with both FLAT and ELF). [1] https://lkml.kernel.org/r/CAG48ez03YJG9JU_6tGiMcaVjuTyRE_o4LEQ7901b5ZoCnNAjcg@mail.gmail.com Jann Horn (2): mmap locking API: Order lock of nascent mm outside lock of live mm exec: Broadly lock nascent mm until setup_arg_pages() arch/um/include/asm/mmu_context.h | 3 +- fs/exec.c | 64 ++++++++++++++++--------------- include/linux/binfmts.h | 2 +- include/linux/mmap_lock.h | 23 ++++++++++- kernel/fork.c | 7 +--- 5 files changed, 59 insertions(+), 40 deletions(-) base-commit: fb0155a09b0224a7147cb07a4ce6034c8d29667f prerequisite-patch-id: 08f97130a51898a5f6efddeeb5b42638577398c7 prerequisite-patch-id: 577664d761cd23fe9031ffdb1d3c9ac313572c67 prerequisite-patch-id: dc29a39716aa8689f80ba2767803d9df3709beaa prerequisite-patch-id: 42b1b546d33391ead2753621f541bcc408af1769 prerequisite-patch-id: 2cbb839f57006f32e21f4229e099ae1bd782be24 prerequisite-patch-id: 1b4daf01cf61654a5ec54b5c3f7c7508be7244ee prerequisite-patch-id: f46cc8c99f1909fe2a65fbc3cf1f6bc57489a086 prerequisite-patch-id: 2b0caed97223241d5008898dde995d02fda544e4 prerequisite-patch-id: 6b7adcb54989e1ec3370f256ff2c35d19cf785aa -- 2.28.0.806.g8561365e88-goog 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 X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BDF7C4727E for ; Fri, 2 Oct 2020 01:24:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2AB3B20878 for ; Fri, 2 Oct 2020 01:24:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="phnG+o1k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AB3B20878 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A298A6B007D; Thu, 1 Oct 2020 21:24:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D9266B007E; Thu, 1 Oct 2020 21:24:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8A20A8E0001; Thu, 1 Oct 2020 21:24:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id 5E48B6B007D for ; Thu, 1 Oct 2020 21:24:01 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E626C180AD801 for ; Fri, 2 Oct 2020 01:24:00 +0000 (UTC) X-FDA: 77325239040.02.wrist10_2615370271a0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id C77C8100C0CD8 for ; Fri, 2 Oct 2020 01:24:00 +0000 (UTC) X-HE-Tag: wrist10_2615370271a0 X-Filterd-Recvd-Size: 4743 Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by imf28.hostedemail.com (Postfix) with ESMTP for ; Fri, 2 Oct 2020 01:24:00 +0000 (UTC) Received: by mail-ej1-f65.google.com with SMTP id u21so575565eja.2 for ; Thu, 01 Oct 2020 18:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:mime-version:date:message-id:subject:to:cc; bh=ZuhbLiKiM/JcAkw5V2qrfXh3m4GeTtm0DV+AllcZcTo=; b=phnG+o1kyRsRwF9i0GexiGaNbZOP24P5O4ULQ5ExpA//VqilVb567sh0HefGxeA8xg nMG3wUlLYwDwz4ju0m6VjavsnNxCh5MJxDO+LJyeqWjOILRr8M1KBstrnZUQ1H7jEgaG V7tVvRw8Fx6gNANGF4V4dkqKva+5oIleHhh3HEfSVIeDZjy9uS09Ntv7j0ce+RhBTF1Q uNwPxns7ceb7L4mDxU8VbGuG7YWdhfiiSKigxqQF5GocQsOaAujd0SYo9X38CLWdA9V6 2OGNFwDeurCJMAYhq9WaWDC678AEwJyWPQELa8jAOn4Wl6+AxVScu4594E9io4FCn4g1 4itA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:date:message-id:subject:to:cc; bh=ZuhbLiKiM/JcAkw5V2qrfXh3m4GeTtm0DV+AllcZcTo=; b=L4rqJGObuhtg/zjDQbfgvxt/RSqKSroYj5T2K37Ula+pKo941oJPAPuro7yRSVSBFL W4qZIgr2A9PNLW3wdRTzfgD9F1t0btUciVOk97nzs1QOoLCYWRGEHdYCrpjq3PSKsXQe 8uKx3s+YP5lQ7kDgqpSyW9wnyQooziLtrtDvND8kHw6kKVBjgTK7vIXoImchta4RLyMN OCYKM8iDXgyWlAevAQH+gAtihpdkZNlJtRx6a6vow106AHewxXk3++4I8fGsNjKaPT4a QbZ30v8Tne5ek62lpptAlV7qpaIJ9nqXtruvpe3jHZyCwdIrwsXkaZUropdZRlRa+QBE C8Pw== X-Gm-Message-State: AOAM530/g7vsFzMiEYeaSKkDYEAGNShmYHZZqI36xS6ny7Luahzw/C27 Z58DAg1f2aB05VhRM1T9ZVGRBz3Uzji8somqK6VVuw== X-Google-Smtp-Source: ABdhPJw5ERWukkY+5ZDguQiFbaiYeqNOoiZ2ZEg/InHvYl6Vbjj5rB8NrevRCvjERC75sEP74nGnWjbbHtYkIX1mGeo= X-Received: by 2002:a17:906:33c8:: with SMTP id w8mr6469076eja.233.1601601838935; Thu, 01 Oct 2020 18:23:58 -0700 (PDT) Received: from 913411032810 named unknown by gmailapi.google.com with HTTPREST; Thu, 1 Oct 2020 21:23:58 -0400 From: Jann Horn X-Mailer: git-send-email 2.28.0.806.g8561365e88-goog MIME-Version: 1.0 Date: Thu, 1 Oct 2020 21:23:58 -0400 Message-ID: Subject: [PATCH 0/2] Broad write-locking of nascent mm in execve To: Andrew Morton , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, "Eric W . Biederman" , Michel Lespinasse , Mauro Carvalho Chehab , Sakari Ailus , Jeff Dike , Richard Weinberger , Anton Ivanov , linux-um@lists.infradead.org, Jason Gunthorpe , John Hubbard Content-Type: text/plain; charset="UTF-8" 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: These two patches replace "mmap locking API: don't check locking if the mm isn't live yet"[1], which is currently in the mmotm tree, and should be placed in the same spot where the old patch was. While I originally said that this would be an alternative patch (meaning that the existing patch would have worked just as well), the new patches actually address an additional issue that the old patch missed (bprm->vma is used after the switch to the new mm). I have boot-tested these patches on x64-64 (with lockdep) and !MMU arm (the latter with both FLAT and ELF). [1] https://lkml.kernel.org/r/CAG48ez03YJG9JU_6tGiMcaVjuTyRE_o4LEQ7901b5ZoCnNAjcg@mail.gmail.com Jann Horn (2): mmap locking API: Order lock of nascent mm outside lock of live mm exec: Broadly lock nascent mm until setup_arg_pages() arch/um/include/asm/mmu_context.h | 3 +- fs/exec.c | 64 ++++++++++++++++--------------- include/linux/binfmts.h | 2 +- include/linux/mmap_lock.h | 23 ++++++++++- kernel/fork.c | 7 +--- 5 files changed, 59 insertions(+), 40 deletions(-) base-commit: fb0155a09b0224a7147cb07a4ce6034c8d29667f prerequisite-patch-id: 08f97130a51898a5f6efddeeb5b42638577398c7 prerequisite-patch-id: 577664d761cd23fe9031ffdb1d3c9ac313572c67 prerequisite-patch-id: dc29a39716aa8689f80ba2767803d9df3709beaa prerequisite-patch-id: 42b1b546d33391ead2753621f541bcc408af1769 prerequisite-patch-id: 2cbb839f57006f32e21f4229e099ae1bd782be24 prerequisite-patch-id: 1b4daf01cf61654a5ec54b5c3f7c7508be7244ee prerequisite-patch-id: f46cc8c99f1909fe2a65fbc3cf1f6bc57489a086 prerequisite-patch-id: 2b0caed97223241d5008898dde995d02fda544e4 prerequisite-patch-id: 6b7adcb54989e1ec3370f256ff2c35d19cf785aa -- 2.28.0.806.g8561365e88-goog From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kO9nm-0000mP-H3 for linux-um@lists.infradead.org; Fri, 02 Oct 2020 01:24:03 +0000 Received: by mail-ej1-x643.google.com with SMTP id a3so519826ejy.11 for ; Thu, 01 Oct 2020 18:23:59 -0700 (PDT) From: Jann Horn MIME-Version: 1.0 Date: Thu, 1 Oct 2020 21:23:58 -0400 Message-ID: Subject: [PATCH 0/2] Broad write-locking of nascent mm in execve List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+geert=linux-m68k.org@lists.infradead.org To: Andrew Morton , linux-mm@kvack.org Cc: Michel Lespinasse , Jason Gunthorpe , Richard Weinberger , Jeff Dike , linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, "Eric W . Biederman" , Sakari Ailus , John Hubbard , Mauro Carvalho Chehab , Anton Ivanov These two patches replace "mmap locking API: don't check locking if the mm isn't live yet"[1], which is currently in the mmotm tree, and should be placed in the same spot where the old patch was. While I originally said that this would be an alternative patch (meaning that the existing patch would have worked just as well), the new patches actually address an additional issue that the old patch missed (bprm->vma is used after the switch to the new mm). I have boot-tested these patches on x64-64 (with lockdep) and !MMU arm (the latter with both FLAT and ELF). [1] https://lkml.kernel.org/r/CAG48ez03YJG9JU_6tGiMcaVjuTyRE_o4LEQ7901b5ZoCnNAjcg@mail.gmail.com Jann Horn (2): mmap locking API: Order lock of nascent mm outside lock of live mm exec: Broadly lock nascent mm until setup_arg_pages() arch/um/include/asm/mmu_context.h | 3 +- fs/exec.c | 64 ++++++++++++++++--------------- include/linux/binfmts.h | 2 +- include/linux/mmap_lock.h | 23 ++++++++++- kernel/fork.c | 7 +--- 5 files changed, 59 insertions(+), 40 deletions(-) base-commit: fb0155a09b0224a7147cb07a4ce6034c8d29667f prerequisite-patch-id: 08f97130a51898a5f6efddeeb5b42638577398c7 prerequisite-patch-id: 577664d761cd23fe9031ffdb1d3c9ac313572c67 prerequisite-patch-id: dc29a39716aa8689f80ba2767803d9df3709beaa prerequisite-patch-id: 42b1b546d33391ead2753621f541bcc408af1769 prerequisite-patch-id: 2cbb839f57006f32e21f4229e099ae1bd782be24 prerequisite-patch-id: 1b4daf01cf61654a5ec54b5c3f7c7508be7244ee prerequisite-patch-id: f46cc8c99f1909fe2a65fbc3cf1f6bc57489a086 prerequisite-patch-id: 2b0caed97223241d5008898dde995d02fda544e4 prerequisite-patch-id: 6b7adcb54989e1ec3370f256ff2c35d19cf785aa -- 2.28.0.806.g8561365e88-goog _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um