Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4551501rdh; Wed, 29 Nov 2023 04:51:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEB9Tuaxsj49fzWXjwbLIRXdQQ8u38uc5MMaGGrztoYeGToN1UvWkKGTOhm6sxFtbXbAhJH X-Received: by 2002:a05:6a20:258b:b0:18c:64e0:447b with SMTP id k11-20020a056a20258b00b0018c64e0447bmr14933625pzd.28.1701262310999; Wed, 29 Nov 2023 04:51:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701262310; cv=none; d=google.com; s=arc-20160816; b=WPd6ZnccdUTC+90rN/qJCVg+o00OorwSteLZideH+pe63oaAMxYgKm61JS6owV5OmL Ca4P2fNN080IlA6ej5h4mw6ND3Yrl4WWn2fMjTG5sImijaTYLwIv8TbBi8o3B9Qf1UyL tTa5VRXSzs8Gw09wk55IIjF7OCPhLLD9fkzgGpH2mYPot3p8O9d/k19cYmDtwcm81XV/ kfrTOGc0//iMH6z08283OihMIWCbUIRezBDJVtIT4oO/emP1tZv18DNeb1IE3/2cWJpr 5vv6aweOLQo7LrTeJn0egRQB4FLg0NC6wxXpRQOtygshEkmYkV5Y6pNEEoY6goecQtUN 760w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=2N/ofzIt/J+wCFOM2pibimYKXpmkpO1wPP6NtnVIANM=; fh=6EEtf8+s6yyABtSDZ6Fe4igLduHvwiZU5fhW8T0ggOw=; b=DE6oi7uuzfLrd/+Z4uRIK9hVcPJIp/3sO+9wvBshd486pLrsOMqgqtsY+vdZYgLl9l mJ2IsmkwdLEbSGdv/k3u0VFge1vbTq3lk9Z7LjrCK7Snmrw7wbho6FhoKtD/rDNX/Nfe bJ4aVyI4IxLYHgfBx/vO7e7KnLodUG+NU/ZnRuuEb68DVBnytyxzNog8xygCxH6yklqS LNcLGIhPOp8axskXC617L9PypP9FzFXZbBroH9fJPhvELrBN6FomgR7a9jqlC8ZN6i3g lHXz2Bxc3SMsjPjs039ms5KN3VFzmsBS3/o0LqB3VJf5ol7y0j5idBKqbxywJhHpbJN7 6kCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xZPXqjwk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f1-20020a17090ace0100b0027cdee52324si1259526pju.74.2023.11.29.04.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 04:51:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=xZPXqjwk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3301F80A7F1B; Wed, 29 Nov 2023 04:51:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231883AbjK2MvZ (ORCPT + 99 others); Wed, 29 Nov 2023 07:51:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232447AbjK2MvX (ORCPT ); Wed, 29 Nov 2023 07:51:23 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1BE210EF for ; Wed, 29 Nov 2023 04:51:27 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5d1b431fa7bso27378797b3.1 for ; Wed, 29 Nov 2023 04:51:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701262287; x=1701867087; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=2N/ofzIt/J+wCFOM2pibimYKXpmkpO1wPP6NtnVIANM=; b=xZPXqjwkwhR7SRFuAgv1Lu2tgSn5EKrCVYq17tBaL7KJRVm+k5cJajpa30QasNFF3A wZS7Nfub4wzzQgew2gvJwDN8cjtlRbc6C4zZOSt+UiZLT6RTzdgzDmz+IefxGlSLvONU Ycw/rCCoQ5sEeNCS5cib5Xdt0W9KQvi6TX5+W6pPMJNMsZz4aBMLJYGtzdW/EYJASDhY EBvBkWxujPRzHAwC2VMffcFT7D2CtYAbEVeori5yPfSGrOzcxaWNxrKstUbtmw63yTVV ZqL5y7huNa3rHs27/ZXcQwZZ33Hg2A9nLsc80oVAGaFNiWGWXvXXY0Zvh0injtW6iNy4 1djQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701262287; x=1701867087; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2N/ofzIt/J+wCFOM2pibimYKXpmkpO1wPP6NtnVIANM=; b=M4kfzD6RQmcaapbcMap8oXtD7ohs9/ZHlawbmtV2eOZW1yHfBIBkSOMAv/8Bd5c0Nu P3ZSnJU08XmSYcbk+2WjDH6HUGXRmMUq59uqLOZaTEufARk50wFtFyO6Rf0z4hH0UFwk rqz4n881p262kM/2TEm1KvneAkQ3+dXJK3qfvcI/bxqFhQab6sEQFeLydK0HA93Wv7au GOiWVFmyPMTWS45WaIMU+5LqCOZonHk8vrLqwu+ANSp7tL5UjPUthE067ylFSazXkZYm CyzVXDo/5B2xVURgH9g1L4lKJDPJraZqqYctOthZlbrbSzilpY7/eFmTOhjtV43zAVdp dhFw== X-Gm-Message-State: AOJu0YxphVSRDvjY/pX3yCV5un31DKQyJlNrGHBgyjrWsgsxqRrZgWHc 6MgqvJJtZjzatXvgpFtX9vZRwtO2kYDMRcA= X-Received: from aliceryhl2.c.googlers.com ([fda3:e722:ac3:cc00:68:949d:c0a8:572]) (user=aliceryhl job=sendgmr) by 2002:a05:690c:842:b0:5cc:cd5e:8f0e with SMTP id bz2-20020a05690c084200b005cccd5e8f0emr544311ywb.0.1701262287138; Wed, 29 Nov 2023 04:51:27 -0800 (PST) Date: Wed, 29 Nov 2023 12:51:06 +0000 Mime-Version: 1.0 X-Developer-Key: i=aliceryhl@google.com; a=openpgp; fpr=49F6C1FAA74960F43A5B86A1EE7A392FDE96209F X-Developer-Signature: v=1; a=openpgp-sha256; l=2950; i=aliceryhl@google.com; h=from:subject:message-id; bh=+8JhMF9v7HhOgu+j5LmeUnyp713AXkmAoTCIofolqXI=; b=owEBbQKS/ZANAwAKAQRYvu5YxjlGAcsmYgBlZzMx3pGGGonpV9d387PqvhcFyHY30cl8eTKds G/Zoe8o2QqJAjMEAAEKAB0WIQSDkqKUTWQHCvFIvbIEWL7uWMY5RgUCZWczMQAKCRAEWL7uWMY5 RsZ3D/0QtI2KNlAPGhZhDHyFLRMViW9DpyAam3A2OsOjPawOiE/VnYGNwTYSTODJHUSDSDXnh7p cU67qdKQRnhTnL1ZC+b5Q3PoHPj0ZNawSTz/z+HY/ezeOAZaX72/PBqz9kbQ6wQCFhMYrqMjG5m tr+ftZKl9hQj5lYQ4UMjvqW5uG4H+J9eJGEedMo87vxL3v249UgALSCAZTCiIGMcUmwFHPqKDP7 skwpUO6zJG/hEULaVfE4FX2NvgUeU2W+/z9lXEvbFz1dg2zXLrJiqt7Hx8sNd4lz55h6Enar//W kkCGdfST3lKIXkepjBjv9Ws2zxb0CzTZsaRxIUsRkyGSTKfsXXf9fcVo9Qsh0UFBccz2Aexb/yB ohYQwiHggZCbUUWBT3pCDbN0AizxpknjIGREphxjAe48vRXi5YmIJ3YS7Y/9DiQ8laHYeabdE5n HxrWyqOUUp3HYC7aDX6qnnBYxg91DxbRGeZGKbTbqcy8y83SF13zARZRIH7njuX2lpFwyXOdQAq rOaPUePKp0r8ZXBtCHl+GYl3Mc5HbZ9O0yxloNKv9Ysl6vZo86bIOPQ8CgZS9kcgXtM7Z3RjUzk 48wUXLr4Bc42MI9GXaLa9cBWSv7YBMuagk6/CjgfsG6Ajnyn4qqeYY1ZFNBbEbUs5wkt4LSkB79 3N75iwGdi3L8lNQ== X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog Message-ID: <20231129-alice-file-v1-0-f81afe8c7261@google.com> Subject: [PATCH 0/7] File abstractions needed by Rust Binder From: Alice Ryhl To: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , "=?utf-8?q?Bj=C3=B6rn_Roy_Baron?=" , Benno Lossin , Andreas Hindborg , Peter Zijlstra , Alexander Viro , Christian Brauner , Greg Kroah-Hartman , "=?utf-8?q?Arve_Hj=C3=B8nnev=C3=A5g?=" , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan Cc: Alice Ryhl , Dan Williams , Kees Cook , Matthew Wilcox , Thomas Gleixner , Daniel Xu , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="utf-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 29 Nov 2023 04:51:48 -0800 (PST) This patchset contains the file abstractions needed by the Rust implementation of the Binder driver. Please see the Rust Binder RFC for usage examples: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-0-08ba9197f637@google.com/ Users of "rust: file: add Rust abstraction for `struct file`": [PATCH RFC 02/20] rust_binder: add binderfs support to Rust binder [PATCH RFC 03/20] rust_binder: add threading support Users of "rust: cred: add Rust abstraction for `struct cred`": [PATCH RFC 05/20] rust_binder: add nodes and context managers [PATCH RFC 06/20] rust_binder: add oneway transactions [PATCH RFC 11/20] rust_binder: send nodes in transaction [PATCH RFC 13/20] rust_binder: add BINDER_TYPE_FD support Users of "rust: security: add abstraction for security_secid_to_secctx": [PATCH RFC 06/20] rust_binder: add oneway transactions Users of "rust: file: add `FileDescriptorReservation`": [PATCH RFC 13/20] rust_binder: add BINDER_TYPE_FD support [PATCH RFC 14/20] rust_binder: add BINDER_TYPE_FDA support Users of "rust: file: add kuid getters": [PATCH RFC 05/20] rust_binder: add nodes and context managers [PATCH RFC 06/20] rust_binder: add oneway transactions Users of "rust: file: add `DeferredFdCloser`": [PATCH RFC 14/20] rust_binder: add BINDER_TYPE_FDA support Users of "rust: file: add abstraction for `poll_table`": [PATCH RFC 07/20] rust_binder: add epoll support This patchset has some uses of read_volatile in place of READ_ONCE. Please see the following rfc for context on this: https://lore.kernel.org/all/20231025195339.1431894-1-boqun.feng@gmail.com/ This was previously sent as an rfc: https://lore.kernel.org/all/20230720152820.3566078-1-aliceryhl@google.com/ Signed-off-by: Alice Ryhl --- Alice Ryhl (4): rust: security: add abstraction for security_secid_to_secctx rust: file: add `Kuid` wrapper rust: file: add `DeferredFdCloser` rust: file: add abstraction for `poll_table` Wedson Almeida Filho (3): rust: file: add Rust abstraction for `struct file` rust: cred: add Rust abstraction for `struct cred` rust: file: add `FileDescriptorReservation` rust/bindings/bindings_helper.h | 9 ++ rust/bindings/lib.rs | 1 + rust/helpers.c | 94 +++++++++++ rust/kernel/cred.rs | 73 +++++++++ rust/kernel/file.rs | 345 ++++++++++++++++++++++++++++++++++++++++ rust/kernel/file/poll_table.rs | 97 +++++++++++ rust/kernel/lib.rs | 3 + rust/kernel/security.rs | 78 +++++++++ rust/kernel/sync/condvar.rs | 2 +- rust/kernel/task.rs | 71 ++++++++- 10 files changed, 771 insertions(+), 2 deletions(-) --- base-commit: 98b1cc82c4affc16f5598d4fa14b1858671b2263 change-id: 20231123-alice-file-525b98e8a724 Best regards, -- Alice Ryhl