From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:57928 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726378AbeG3WNS (ORCPT ); Mon, 30 Jul 2018 18:13:18 -0400 Date: Mon, 30 Jul 2018 13:36:33 -0700 From: Matthew Wilcox To: Christoph Hellwig Cc: Christian Brauner , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, arve@android.com, tkjos@android.com, maco@android.com, rlove@google.com, ben@decadent.org.uk Subject: Re: [PATCH 1/4] file: export __alloc_fd() Message-ID: <20180730203633.GC12962@bombadil.infradead.org> References: <20180730143710.14413-1-christian@brauner.io> <20180730143710.14413-2-christian@brauner.io> <20180730163155.GA27761@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180730163155.GA27761@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Jul 30, 2018 at 09:31:55AM -0700, Christoph Hellwig wrote: > On Mon, Jul 30, 2018 at 04:37:07PM +0200, Christian Brauner wrote: > > The Android binder driver will be turned into a module. Since it uses > > __alloc_fd() we need to export this function. > > Err, hell no. > > It should be using an anon fd probably. I'm not entirely sure I understand the binder code (... does anyone?) but from what I can see, it intends to open a file descriptor in the process which is the target of the message being sent. That strikes me as wrong-headed; it should be allocating a struct file and passing that file to the other process. When that process receives the message, *it* allocates a file descriptor for itself. But I think the binder user-space API relies on this. The userspace API seems to rely on passing fd numbers around ... but I'm having trouble figuring most of this user API out. Perhaps Martijn can help here.