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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 3D390C4361B for ; Wed, 16 Dec 2020 18:08:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7DACA2494F for ; Wed, 16 Dec 2020 18:08:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DACA2494F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A01686B0036; Wed, 16 Dec 2020 13:08:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9B28F6B005C; Wed, 16 Dec 2020 13:08:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8533D6B005D; Wed, 16 Dec 2020 13:08:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 6F3D76B0036 for ; Wed, 16 Dec 2020 13:08:54 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 30553181AEF09 for ; Wed, 16 Dec 2020 18:08:54 +0000 (UTC) X-FDA: 77599931388.07.park71_36107392742e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 0C4511803F9B0 for ; Wed, 16 Dec 2020 18:08:54 +0000 (UTC) X-HE-Tag: park71_36107392742e X-Filterd-Recvd-Size: 4935 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) by imf20.hostedemail.com (Postfix) with ESMTP for ; Wed, 16 Dec 2020 18:08:52 +0000 (UTC) Received: by mail-qv1-f42.google.com with SMTP id az16so9730903qvb.5 for ; Wed, 16 Dec 2020 10:08:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9RuRINEpy6taTrli4Abb9av9pTwORzMZWlBEpd7n9iI=; b=fWxXBYwjnor2vNhTVKiXmqivKAo17rMoF2gMLgk8lmsTgtGz3fZyF3HFDsBgVPQg+h Ue2MmlCuF9rVpXFix1ti15uJuqaer6hUxf3JxsHqWh5S8t6pnFOKRNWVxnu7/BPb0MY0 Gmoy1YwKQHMYegUsvOYdtQX2OLXCiNsOn+B5UixMgaiHXyaSiyAh7+ZEoSpzHUNEJCn4 HiPclSq5a9OI8D+aunn5kCf563bvjENEwWIFX9yUYLnhCKqaliUf6gF0JO55Y2SGKEft TrcCV/TCpps256CrxnJl41MOX+YflAfQxct4LLKtN5tiMlxoD4IxY+cIgcOrDVFT1D/m L4Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9RuRINEpy6taTrli4Abb9av9pTwORzMZWlBEpd7n9iI=; b=Km/qOQDfhrXeD0mObK25tBF9pXf5LA+B5O8rwN9m6IvvVpG/r6DeSSuJ9R7BhGY24K O7QGQ4THUk6tK425WRkyVCB/mBfzXhtzvw8U4M22rRltEDLJov9Xfr1R5rmZ49fGs7HU CDuOJVS7e6YakbfzTockrPYWSxwONYhLu725VNQ4n62H8embRCLC7O3h5/GURZyeCZqz ichOGgi+E5MNyoUKDlFMLZgmzkPJAAUEDAzkjkGwE2ooVYkcVb6M8zQkW/+73gmctdpp 1Xp2bCPwRBy5W/J3mQppU6v3OrMQWBgldi30GWFcNEwjTR/gUYHo3/zfBX05JynQRazp 2xVA== X-Gm-Message-State: AOAM531ZyRCyemCGujfRozTFWNGGKJoVI4QbYET3IjXkPtYJeEDDWtcQ AyDgAYiSqtD8ovNm35b5ZWSucg== X-Google-Smtp-Source: ABdhPJy40VwKx1K25jBs/v9w7SsyuBlT+iI9Fu8KXWDK4dDn11JlfEQuMrfqbyNfXnbnVg9jLvtfIQ== X-Received: by 2002:a0c:eed3:: with SMTP id h19mr44640441qvs.18.1608142132233; Wed, 16 Dec 2020 10:08:52 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-115-133.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.115.133]) by smtp.gmail.com with ESMTPSA id x13sm1377952qtf.89.2020.12.16.10.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 10:08:51 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kpbEI-00BhOP-Jv; Wed, 16 Dec 2020 14:08:50 -0400 Date: Wed, 16 Dec 2020 14:08:50 -0400 From: Jason Gunthorpe To: Jann Horn Cc: Andrew Morton , "Eric W. Biederman" , John Hubbard , Linux-MM , Mauro Carvalho Chehab , mm-commits@vger.kernel.org, Sakari Ailus , Linus Torvalds , Michel Lespinasse Subject: Re: [patch 94/95] mmap locking API: don't check locking if the mm isn't live yet Message-ID: <20201216180850.GH5487@ziepe.ca> References: <20201215204156.f05ec694b907845bcfab5c44@linux-foundation.org> <20201216044730.ADFV7TjN3%akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed, Dec 16, 2020 at 06:07:48AM +0100, Jann Horn wrote: > On Wed, Dec 16, 2020 at 5:47 AM Andrew Morton wrote: > > In preparation for adding a mmap_assert_locked() check in > > __get_user_pages(), teach the mmap_assert_*locked() helpers that it's fine > > to operate on an mm without locking in the middle of execve() as long as > > it hasn't been installed on a process yet. > > > > Existing code paths that do this are (reverse callgraph): > > > > get_user_pages_remote > > get_arg_page > > copy_strings > > copy_string_kernel > > remove_arg_zero > > tomoyo_dump_page > > tomoyo_print_bprm > > tomoyo_scan_bprm > > tomoyo_environ > > Sorry, can you please kill both this patch and the following one > ("mm/gup: assert that the mmap lock is held in __get_user_pages()") > from the mm tree? > > I'll send new stuff (a new iteration of > https://lore.kernel.org/linux-mm/20201016225713.1971256-1-jannh@google.com/ > "[PATCH resend v3 0/2] Broad write-locking of nascent mm in execve", > followed by a resend of "mm/gup: assert that the mmap lock is held in > __get_user_pages()") when it's ready. I'm glad you are still working on it, I think finally being able to add lockdep to get_user_pages will be a help. I've fixed a number of wrongly locked get_user_pages users :( Thanks, Jason