Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2358916rdb; Mon, 5 Feb 2024 04:21:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IG9U0L7AkSykHAylWEHu6uA4zjl1J0TrkBCzkvQRwdCOqkaSPIqG2YKpEwWAcolcgYHj/J5 X-Received: by 2002:a05:6a00:4298:b0:6e0:42cb:d794 with SMTP id bx24-20020a056a00429800b006e042cbd794mr3433255pfb.34.1707135674309; Mon, 05 Feb 2024 04:21:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707135674; cv=pass; d=google.com; s=arc-20160816; b=QImGLjpw6DGIi1CGGtp3mbYh0D6kWNfMgFxdSomzbwXxk7UJYqarFVXE+8jnLsQJLS 2s9sSWCVUPNri6P/NJkBFhzimS5+0dgzNibCDv9XSIaxkMzbn5fauYtAANK4KrsLWTaA F5AIxXpAYMW1THbbqWo6L3+r5K2bZCXb6ADA4/29G0ZQepqnwDgKb/0NGYCb7WXmc8R7 Gt5Mndk1QvQS7UwGJ8yKYzGxsA9xF89FcJQXRjFQPpGaY5ERLMS7Np+M9jX4Spobkkq8 CuFn9TVAh1GU5vNyXjZ++jhXTkFENux3tUYu8hEMSwXKs47BR3eKLC+xRw2U8uHLHOoJ L8IA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=DaP+uYIz8KmFM7LmToBkEKWVv9jbRasxcLtql4VpI7I=; fh=ZQ9jvlDwkfX92NwRRKY5ofThOM+dVi8wpSSszuNfqYU=; b=DZilD5/f3wVkcMQv2suuAeaRKpeZwnqTWf5Zhw5Qfcrx0GpUeezIEPvJCF1Y6E1i1r 95QqQa57Z1EMxG++6PGlnVYx1iIOzeJOBL4xZd1nQmwMPh41NScK3wGLEn9AxzHII8eY ZxtLcZqiKdtvBL/go7DEh4Jeh1huPTCXTo1VmYDw9kz3yKACLCvy8TDzMpqTxH3aFvhy LDW3lMhtBotBG/y+pAFGGo8mca2Fgj5iycgnhWUWCowU+sElgAPzrjyxID1aT6gxYUA7 L4KkKNvFz25umKifxN4X2rLrFsAjz4xGyNZ1PuWZQA/sDG9iFAOV8mDMhbOj4p1N7+oi cjFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=gFJTrvji; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-52589-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52589-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me X-Forwarded-Encrypted: i=1; AJvYcCW4pdzzIFXl5VZVoIZXZY35KF1JRU9CBQ4Q5PecmdptxzHjjvH0IOwyyBkEhE6sAMhoKeMM17G351yWRz+JYPSAUmrAzKTnn9eaXSZ4bg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z35-20020a056a001da300b006e03cefd754si2393178pfw.13.2024.02.05.04.21.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 04:21:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-52589-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=gFJTrvji; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-52589-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-52589-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F0206281692 for ; Mon, 5 Feb 2024 12:21:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E50A31BC58; Mon, 5 Feb 2024 12:20:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="gFJTrvji" Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6387B1C291 for ; Mon, 5 Feb 2024 12:20:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707135633; cv=none; b=QenWaf6aRFRlXaEMWL6t7EEL32AyJsJL3/gm4a0tzmOnAWNg8WP3ggYIkz3faXqy2TP2GIcIxryqwv8U5nphyLyzNl5KRyRBI7zLc1Vv7A7NvtBbx9+rMJcm+2CEa1VXVg2xXekUDKln8NVQy4a3KXYTllmQxhgsIvV7mveMno0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707135633; c=relaxed/simple; bh=FSqx85FKav5UTjkwrO0C/DvlGRzbLe0MGXGqjZ2Gkcc=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lOyVWgpSEEgjMGorTOYtu6OYwvu97SD9YgRkYLAyzCvKuMCYl/4cx7dniSnDsW2rYFjeTD27bU4wPcdUoN0gpyyjN9w/+2eiOE6eAnR9qkxKfZtcrwHAt5ZWvFQzmjYxVsHFt+Osh8YqY0zBfQdXaCx7IhxHRB6u9btE8tBJz6k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=gFJTrvji; arc=none smtp.client-ip=185.70.40.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1707135628; x=1707394828; bh=DaP+uYIz8KmFM7LmToBkEKWVv9jbRasxcLtql4VpI7I=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=gFJTrvjie5dIOI+j7tg45YffNTUKliKqj/6ogvDOw92xcJdevRwTRv/L2jitWhsEa lVA4+dSQTvi183O0U8wfCAEzQ+FYQveY/lpgo11e4jarAdoValLvnsUG+8NMD4GgIY 3iui1LL21jOrHOjjmkdruPX104S42Id0+2vxUL176O0uB/kJCmtx2pSphyEX5rTK0j hj8eqFHjl0bBaa6JI7j241HIpQ53sHqAyp4GCVe6SCzwy3AblHIT0NyXylOzcyR5NU suEprCRfQyE+KqzNvgubSlF9VVblouIxj9acW+7Tc2sMo8G8Erf/Z6asOq/GfriHzp NyvLUmpUfQ7uA== Date: Mon, 05 Feb 2024 12:20:12 +0000 To: Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , 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 , Dan Williams , Kees Cook , Matthew Wilcox , Thomas Gleixner From: Benno Lossin Cc: Daniel Xu , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v4 4/9] rust: cred: add Rust abstraction for `struct cred` Message-ID: <4da53a00-77e5-4062-a743-c48e93235b97@proton.me> In-Reply-To: <20240202-alice-file-v4-4-fc9c2080663b@google.com> References: <20240202-alice-file-v4-0-fc9c2080663b@google.com> <20240202-alice-file-v4-4-fc9c2080663b@google.com> Feedback-ID: 71780778:user:proton Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2/2/24 11:55, Alice Ryhl wrote: > From: Wedson Almeida Filho >=20 > Add a wrapper around `struct cred` called `Credential`, and provide > functionality to get the `Credential` associated with a `File`. >=20 > Rust Binder must check the credentials of processes when they attempt to > perform various operations, and these checks usually take a > `&Credential` as parameter. The security_binder_set_context_mgr function > would be one example. This patch is necessary to access these security_* > methods from Rust. >=20 > Signed-off-by: Wedson Almeida Filho > Co-developed-by: Alice Ryhl > Signed-off-by: Alice Ryhl > --- > rust/bindings/bindings_helper.h | 1 + > rust/helpers.c | 13 ++++++ > rust/kernel/cred.rs | 72 +++++++++++++++++++++++++++++++++ > rust/kernel/file.rs | 13 ++++++ > rust/kernel/lib.rs | 1 + > 5 files changed, 100 insertions(+) > create mode 100644 rust/kernel/cred.rs Reviewed-by: Benno Lossin -- Cheers, Benno