Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp1100542rdb; Wed, 1 Nov 2023 11:13:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGT4cHcmsMuKMADvPQiFY+1QGt2fXSMqpmMcRA/jvEn5FYicSwg4XefBdYredZ578uT8j03 X-Received: by 2002:a05:6a20:914e:b0:172:83b8:67f8 with SMTP id x14-20020a056a20914e00b0017283b867f8mr15847419pzc.29.1698862438241; Wed, 01 Nov 2023 11:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698862438; cv=none; d=google.com; s=arc-20160816; b=msAh/FAuglTONp83IQh7NiOinRC1r8nBL5oZf2IKm5w3thCmOVkKK0qKjNctR8FXdu RxPqDUjc97oDYeetB0GG3gxiA/5lAnnqpBsoTog+GAQv+Imb4qllzsfWg3jtGBTay/T2 feDqXskyCA+ZRgWz1NOno1qNthZZEYlm8BeJuicdxNSxwGZHWlVHQdifHBZbW6ZjtFQZ B4g9YAfS0jeyVpRTtFD55jcjpb2BpJQuDwh7lY1f60DdZB3xc/fIDPzZfcYGuKeAFHFG A0cD7abCZz8/1RwatAQzk9wV+uloWnvS+mjJoQW4bogzfen/HLW1SPCVhaT5APrZ4MFf /XtQ== 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:dkim-signature; bh=+I4fd3RbBOPAfpXxOhHicaZALuPOoei9Xf9pL90BndE=; fh=CQkYyolx0UdhFT11/dm9y63KXNgmCd3XqAxNMl2YPpM=; b=GyuLMhZLCNWJ0ZRM+CpUyzK1kB5VxBYecGagG1Ep3QcnoNX5YO0lPDeVjNT7+F37T8 +GbWNjYex+SIK97TSM2NmSM2cCpeHdNHRJPLJX82CENsS38QlRzgPg5gW9WakiLKvuzW rB/cympVjniqWNObHbgtNmoaTTr4B/i6jnUAqeTVRqtVzfudqiq5+LFgCrtWqayKLSUe Qpn74AqDzAWehccGfZktgG+BnVZVUlpn8drZV9b3m6Y2seBa1rRfi9jUZ/e4zVChguT4 InsRw6DozlMaM3mDgpN6wCTkwvNQmMfyavbkLfvQg0yDJyyyDDo1Lt95EQb0RCObTfkI cYpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xT99Btqr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id k11-20020aa788cb000000b0068fdeb84453si2241936pff.265.2023.11.01.11.13.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 11:13:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xT99Btqr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 436808028B44; Wed, 1 Nov 2023 11:13:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234068AbjKASMs (ORCPT + 99 others); Wed, 1 Nov 2023 14:12:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234274AbjKASMq (ORCPT ); Wed, 1 Nov 2023 14:12:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0174330E2 for ; Wed, 1 Nov 2023 11:11:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68CABC433C9; Wed, 1 Nov 2023 18:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1698862212; bh=3NZHEsX4YnmtaYDxknYFjkreaqS3P2LL75ju5leBvWw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xT99BtqreVGR7rW2IVViyuQwA+xdvX+/dQ4qq/WvIk90aZVsl2ME2R4Is/VV9kpIH R0IJEZ833B6UX5KLWuJigM1KA1oX548NrU+HYN6KOsEO8o+sEfzl9+uGYjJLJjAG6B bhbpZLUnQRkJO+CgOQ6ohFYbFdYEsS6Gbe9efWls= Date: Wed, 1 Nov 2023 19:10:04 +0100 From: Greg Kroah-Hartman To: Alice Ryhl Cc: Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Carlos Llamas , Suren Baghdasaryan , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Matt Gilbride , Jeffrey Vander Stoep , Matthew Maurer Subject: Re: [PATCH RFC 02/20] rust_binder: add binderfs support to Rust binder Message-ID: <2023110124-enunciate-hypnotize-2ae9@gregkh> References: <20231101-rust-binder-v1-0-08ba9197f637@google.com> <20231101-rust-binder-v1-2-08ba9197f637@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231101-rust-binder-v1-2-08ba9197f637@google.com> X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 11:13:43 -0700 (PDT) On Wed, Nov 01, 2023 at 06:01:32PM +0000, Alice Ryhl wrote: > Add support for accessing the Rust binder driver via binderfs. The > actual binderfs implementation is done entirely in C, and the > `rust_binderfs.c` file is a modified version of `binderfs.c` that is > adjusted to call into the Rust binder driver rather than the C driver. > > We have left the binderfs filesystem component in C. Rewriting it in > Rust would be a large amount of work and requires a lot of bindings to > the file system interfaces. Binderfs has not historically had the same > challenges with security and complexity, so rewriting Binderfs seems to > have lower value than the rest of Binder. > > We also add code on the Rust side for binderfs to call into. Most of > this is left as stub implementation, with the exception of closing the > file descriptor and the BINDER_VERSION ioctl. > > Co-developed-by: Wedson Almeida Filho > Signed-off-by: Wedson Almeida Filho > Signed-off-by: Alice Ryhl > --- > drivers/android/Kconfig | 24 ++ > drivers/android/Makefile | 1 + > drivers/android/context.rs | 144 +++++++ > drivers/android/defs.rs | 39 ++ > drivers/android/process.rs | 251 ++++++++++++ > drivers/android/rust_binder.rs | 196 ++++++++- > drivers/android/rust_binderfs.c | 866 ++++++++++++++++++++++++++++++++++++++++ > include/linux/rust_binder.h | 16 + > include/uapi/linux/magic.h | 1 + > rust/bindings/bindings_helper.h | 2 + > rust/kernel/lib.rs | 7 + > scripts/Makefile.build | 2 +- > 12 files changed, 1547 insertions(+), 2 deletions(-) > > diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig > index fcfd25c9a016..82ed6ddabe1a 100644 > --- a/drivers/android/Kconfig > +++ b/drivers/android/Kconfig > @@ -36,6 +36,18 @@ config ANDROID_BINDERFS > It can be used to dynamically allocate new binder IPC devices via > ioctls. > > +config ANDROID_BINDERFS_RUST > + bool "Android Binderfs filesystem in Rust" > + depends on ANDROID_BINDER_IPC_RUST > + default n Nit, the default is always 'n', so no need for this line. Also, it's the middle of the merge window, many of us are busy with other things and can't review new code until a few weeks from now, sorry. greg k-h