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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 35706C433E1 for ; Fri, 21 Aug 2020 07:53:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F3CC422CB2 for ; Fri, 21 Aug 2020 07:53:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3CC422CB2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8295D8D0012; Fri, 21 Aug 2020 03:53:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B4278D0006; Fri, 21 Aug 2020 03:53:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62C8D8D0012; Fri, 21 Aug 2020 03:53:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0086.hostedemail.com [216.40.44.86]) by kanga.kvack.org (Postfix) with ESMTP id 47B3B8D0006 for ; Fri, 21 Aug 2020 03:53:08 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 02E2D3643 for ; Fri, 21 Aug 2020 07:53:08 +0000 (UTC) X-FDA: 77173810056.18.lamp01_120b32027037 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id C6008100EC66B for ; Fri, 21 Aug 2020 07:53:07 +0000 (UTC) X-HE-Tag: lamp01_120b32027037 X-Filterd-Recvd-Size: 3703 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf03.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Aug 2020 07:53:07 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 7ADA3AEEB; Fri, 21 Aug 2020 07:53:33 +0000 (UTC) Date: Fri, 21 Aug 2020 09:53:04 +0200 From: Michal Hocko To: Sumit Semwal Cc: Colin Cross , Andrew Morton , Linux-MM , lkml , Alexey Dobriyan , Jonathan Corbet , Mauro Carvalho Chehab , Kees Cook , Alexey Gladkov , Matthew Wilcox , Jason Gunthorpe , "Kirill A . Shutemov" , Michel Lespinasse , Michal =?iso-8859-1?Q?Koutn=FD?= , Song Liu , Huang Ying , Vlastimil Babka , Yang Shi , chenqiwu , Mathieu Desnoyers , John Hubbard , Mike Christie , Bart Van Assche , Amit Pundir , Thomas Gleixner , Christian Brauner , Daniel Jordan , Adrian Reber , Nicolas Viennot , Al Viro , Thomas Cedeno , linux-fsdevel@vger.kernel.org, Pekka Enberg , Dave Hansen , Peter Zijlstra , Ingo Molnar , Oleg Nesterov , "Eric W. Biederman" , Jan Glauber , John Stultz , Rob Landley , Cyrill Gorcunov , "Serge E. Hallyn" , David Rientjes , Hugh Dickins , Mel Gorman , Robin Holt , Shaohua Li , Johannes Weiner , Minchan Kim Subject: Re: [PATCH v5 2/2] mm: add a field to store names for private anonymous memory Message-ID: <20200821075304.GC32537@dhcp22.suse.cz> References: <20200819141650.7462-1-sumit.semwal@linaro.org> <20200819141650.7462-3-sumit.semwal@linaro.org> <20200820075846.GA5033@dhcp22.suse.cz> <20200821072334.GB32537@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200821072334.GB32537@dhcp22.suse.cz> X-Rspamd-Queue-Id: C6008100EC66B X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Fri 21-08-20 09:24:02, Michal Hocko wrote: > On Fri 21-08-20 08:51:57, Sumit Semwal wrote: [...] > > Indeed. so does it sound ok to add an access_remote_vma_mmap_lockheld() version? > > You will still need to take the lock if the pointer belongs to a remote > address space. But how are you going to find out? Scratch that. I didn't realize prctl is always called with the current context. So there will never be a pointer from a remote process. Going with a variant which doesn't take mmap_sem would be safe. Sorry about the confusion. -- Michal Hocko SUSE Labs