Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp916894rwb; Thu, 6 Oct 2022 06:17:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4TU48mjNhdC/bhI5efEtsj6fKv4exBQjTgiFTDO4VpAmaDGKHZmfGhQsp5RCoegjZsoM/G X-Received: by 2002:a17:907:1691:b0:78d:4051:9429 with SMTP id hc17-20020a170907169100b0078d40519429mr3265600ejc.721.1665062250841; Thu, 06 Oct 2022 06:17:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665062250; cv=none; d=google.com; s=arc-20160816; b=VCKWbAWcNCv2cZ7bfYHqGTSLQTiWyJgMxD9LQZvq/4jJXomqGLXB8YyynFmqRotOWc Li4hUJ0IV+qYY3APS2pNqjjte1w4tvf0trKJSdN/PkHA83o2DxAvMeq2KOTnZjWfvS+j H4QCodqzf6IgqNnNifN8eN5uDOf8vUjfgzCWuiYNlwEr6PF7Ub+35W+2MKfyhAY3kiR3 ZS8ipq0cp7qFFhYcgJqS174XA9iirtiCT0A1aAGYMN/MOL3iM9GfT9uPS0jCIYXZTsFj o2Hou4l4bIIotN8s2I3NGimhqW73wWMKit9/taXQ11jXxgOszxGwi4n7b5keO2WY9dmy Rhow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=N6it90zhKBeS6kpjpWHzwwnMSuYeK60zqUPbb7rWWk4=; b=ruXc5WkKA1CqBmZjzUe4V0IemiltZ01P6v50h967JkboW/0UZ7EKft87P5opK3ovMA JnRcu5weos08Z2dxxpOiM+xwm3iUOaqtw5jD9S9qqtgIcC2Q6+EeoLhkwqhUREMhUn9j +6kxWOhB6KVGgwSTHbSBS1iNrHqKtx9rRCvwEaMkdBiV1TjCL3J5Q4zOfY15qSRzm3Rv OIkHAhUZezourJqr/C9OJPrQJqs9UYT9xrfKITGrkiMcO3JfAdfvaC3CZECMWMNs9iPq iuYOjvMjm/3Nk4otYSTx70QhoIWkB4S7JJ+QuosrDMh3cKNf4d+pRa68s54eLsqkytfR NiXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm1 header.b="XTgNicp/"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=FAaPD96z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz11-20020a1709077d8b00b00780e022dfb8si19717949ejc.494.2022.10.06.06.16.59; Thu, 06 Oct 2022 06:17:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm1 header.b="XTgNicp/"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=FAaPD96z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229525AbiJFNEX (ORCPT + 99 others); Thu, 6 Oct 2022 09:04:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbiJFNEV (ORCPT ); Thu, 6 Oct 2022 09:04:21 -0400 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 764B9A3466; Thu, 6 Oct 2022 06:04:17 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 023085803FD; Thu, 6 Oct 2022 09:04:16 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 06 Oct 2022 09:04:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1665061455; x=1665068655; bh=N6 it90zhKBeS6kpjpWHzwwnMSuYeK60zqUPbb7rWWk4=; b=XTgNicp/w6VyyZaRPv n4u89Y3VpJN0otlae1qyySdCkPUukZ695QdJy/OCy3++7pohYhDzlWsBkWKlQJnF zawbDkPiWAL+qX37FxpvztDyhcIQ7u804FSnaWHTxgf00r6YgtQGLMJkZ5U6GYbR YubxB3iGl1ZgFlNzemCy84m07QUj0p16Zi9PQzv/5PwIHtMNwZL2Dhc+BED6Kl8b M5lKq1X5teQz4f9aj4K3r2NpFmepGMiE+WN6QNx1P8/w4AntZGlp4rCO0gzvzW69 sDnJ7MAI0QQdTetsS2DYE/U8hSNjrA7HIjuawWRV7bLDET+jfZ08TCMnecqIqjrY GAdw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1665061455; x=1665068655; bh=N6it90zhKBeS6kpjpWHzwwnMSuYe K60zqUPbb7rWWk4=; b=FAaPD96zc+b9K5xKH2cUqvkpol+I33Kkf0et42qgz8z+ o1eNBQnQKM1AvC//U+cQVmrrqBd30HogyMEDiVxKvZdgTerM/pTVx2QnyIXOEv7d 60qslQZq3oWYM357Kd0o2xFwFf/0neVFntfmjMVLCvmPvsd4RUTzfau1b5gQuKjR iwPI146Sf0m0L9eJr2iXTgvFnYamJOGcYab+IB4nXczcS1og8ic4XumxPvS6Inuh MF5f8pJHOqfKa4fTi/Zc+HEg6NZRImJn1PwL0WZzUPoojpighNgVGN7e2QnppkQB AyzUbVcL6ZrNN0AxCHcceqU3axK2l7bbi73RHaGaXw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeeihedgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdttddttddtvdenucfhrhhomhepfdfmihhr ihhllhcutedrucfuhhhuthgvmhhovhdfuceokhhirhhilhhlsehshhhuthgvmhhovhdrnh grmhgvqeenucggtffrrghtthgvrhhnpefhieeghfdtfeehtdeftdehgfehuddtvdeuheet tddtheejueekjeegueeivdektdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehkihhrihhllhesshhhuhhtvghmohhvrdhnrghmvg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 Oct 2022 09:04:11 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id 7C346104D90; Thu, 6 Oct 2022 16:04:08 +0300 (+03) Date: Thu, 6 Oct 2022 16:04:08 +0300 From: "Kirill A. Shutemov" To: Fuad Tabba Cc: Chao Peng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song , wei.w.wang@intel.com Subject: Re: [PATCH v8 1/8] mm/memfd: Introduce userspace inaccessible memfd Message-ID: <20221006130408.2bnuikg6peilaycp@box.shutemov.name> References: <20220915142913.2213336-1-chao.p.peng@linux.intel.com> <20220915142913.2213336-2-chao.p.peng@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 06, 2022 at 09:50:28AM +0100, Fuad Tabba wrote: > Hi, > > <...> > > > > diff --git a/mm/memfd_inaccessible.c b/mm/memfd_inaccessible.c > > new file mode 100644 > > index 000000000000..2d33cbdd9282 > > --- /dev/null > > +++ b/mm/memfd_inaccessible.c > > <...> > > > +struct file *memfd_mkinaccessible(struct file *memfd) > > +{ > > + struct inaccessible_data *data; > > + struct address_space *mapping; > > + struct inode *inode; > > + struct file *file; > > + > > + data = kzalloc(sizeof(*data), GFP_KERNEL); > > + if (!data) > > + return ERR_PTR(-ENOMEM); > > + > > + data->memfd = memfd; > > + mutex_init(&data->lock); > > + INIT_LIST_HEAD(&data->notifiers); > > + > > + inode = alloc_anon_inode(inaccessible_mnt->mnt_sb); > > + if (IS_ERR(inode)) { > > + kfree(data); > > + return ERR_CAST(inode); > > + } > > + > > + inode->i_mode |= S_IFREG; > > + inode->i_op = &inaccessible_iops; > > + inode->i_mapping->private_data = data; > > + > > + file = alloc_file_pseudo(inode, inaccessible_mnt, > > + "[memfd:inaccessible]", O_RDWR, > > + &inaccessible_fops); > > + if (IS_ERR(file)) { > > + iput(inode); > > + kfree(data); > > I think this might be missing a return at this point. Good catch! Thanks! -- Kiryl Shutsemau / Kirill A. Shutemov