Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp207153rdb; Thu, 30 Nov 2023 02:37:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IELD4RXmAn7iut6ZfKcNnl9AeGWwl41e1x0lOdiJxQh92mHeY3r8WHug+BPPvSsTvTE99nY X-Received: by 2002:a05:6870:f783:b0:1ea:c913:3494 with SMTP id fs3-20020a056870f78300b001eac9133494mr29520031oab.6.1701340667418; Thu, 30 Nov 2023 02:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701340667; cv=none; d=google.com; s=arc-20160816; b=AFaVO9kgiJS8MHxhOu8OqGvkx/iwxYZ8HwqA7bMpILDICHPDn9tUl14mIllxEkdnxw 6ns3TBFzzyxpf5hYra56XaSE4GO3cfx+lvep8nVMToaHG1MuY0qOEgzXOJrXes6dMpeH QEG0LC3gKkjHK+7Z2/7eZhV7L2tgTZtgzxgJkh/eObCV8pE4+8RCjM1ldS+cDtyJji1h e+tOo+l2V2Vb7iyo74QIWQtgW3T9nh86enzdITJ9d26N+HgbzeVEzA6vY31azCdi6yKU jBvf+Q58+ayduJBIKasDagQYue69GSWpXeDKrkNzxK4viyVNGEYK3Bjk22pzZvcEcHAi weDA== 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=MJ2Nv64cnRBVTENP4eJGBA77a/TG6CtKUt1zxTIVNGY=; fh=1nnaX2et5TuIayHwjGSOfCCgCwqg6q2LzWVai7Y7FpI=; b=uipNqdV3QGgvcG6s251zI4JNpv+eCMcpzIDcnGIMRNSKoD/tKOOV7c/1I/hgFxEtUx /rA5et32Q5m2utbFmDr6EgihLNq3i67HDbYapg4GKCs1MVPtcYTQ8WeFTYHV9CQKhaot 7ElB/6ewJoxt00UR34/hmiveI8+5koiGSwFp1k2rSyha41Qcx/ODCeriKz2FiL4P+wGM iBLG9NdqMwd9ODasvPW/AeQla1NafH2e4gi4r8r3bz/65seA8OWQz5z3YFDIEufXDVn+ RjkQbM1KR/Ex2xZSMzX+cUi1puNItzLemjrfUPfCNcB7ovUx6TfIFglCXdrM9R3yUFbr 56sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=K6nZwXf0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id k67-20020a632446000000b005b9600b9f4asi1113200pgk.228.2023.11.30.02.37.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 02:37:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=K6nZwXf0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8BF998042D2F; Thu, 30 Nov 2023 02:37:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345021AbjK3KhX (ORCPT + 99 others); Thu, 30 Nov 2023 05:37:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345071AbjK3KhC (ORCPT ); Thu, 30 Nov 2023 05:37:02 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1259810EF; Thu, 30 Nov 2023 02:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=MJ2Nv64cnRBVTENP4eJGBA77a/TG6CtKUt1zxTIVNGY=; b=K6nZwXf03a42iyVAFAzroplPQo P/ws9/5VH+Ywxwg/qSNQLTq+yC4vsVlHgESDQE7QbF5DPIlSshkjwz0WlgO9lyfjkUlGAdzO32e8M k1T4Ft0aUtY8ZpsIKgQWv05ZatBrpHQw5Tl6Jb+e2y+b1rQf2gn3cB+0uJDfT/6FgxB6IAQeShUng lNuwTuX/dW9Q135DZkOE5LHr1g6xcCh+KL69x8rj9mr6jDE4DnI0zwMqA0uIyTLrmUD6eahm9QjPx 6EVh6RqcrI4tMQp36J/Sga9pyeFrfqxxa/0YZbXC6Vx/qxN7ZZVsnQ3/DanB1xDe432+ZbEuAYT8N X7Nfgctw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1r8ePL-0011fC-2j; Thu, 30 Nov 2023 10:36:36 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 265D8300293; Thu, 30 Nov 2023 11:36:35 +0100 (CET) Date: Thu, 30 Nov 2023 11:36:35 +0100 From: Peter Zijlstra To: Alice Ryhl Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alexander Viro , Christian Brauner , Greg Kroah-Hartman , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan , 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 Subject: Re: [PATCH 5/7] rust: file: add `Kuid` wrapper Message-ID: <20231130103635.GA20191@noisy.programming.kicks-ass.net> References: <20231129-alice-file-v1-0-f81afe8c7261@google.com> <20231129-alice-file-v1-5-f81afe8c7261@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231129-alice-file-v1-5-f81afe8c7261@google.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 02:37:37 -0800 (PST) On Wed, Nov 29, 2023 at 01:12:17PM +0000, Alice Ryhl wrote: > diff --git a/rust/helpers.c b/rust/helpers.c > index fd633d9db79a..58e3a9dff349 100644 > --- a/rust/helpers.c > +++ b/rust/helpers.c > @@ -142,6 +142,51 @@ void rust_helper_put_task_struct(struct task_struct *t) > } > EXPORT_SYMBOL_GPL(rust_helper_put_task_struct); > > +kuid_t rust_helper_task_uid(struct task_struct *task) > +{ > + return task_uid(task); > +} > +EXPORT_SYMBOL_GPL(rust_helper_task_uid); > + > +kuid_t rust_helper_task_euid(struct task_struct *task) > +{ > + return task_euid(task); > +} > +EXPORT_SYMBOL_GPL(rust_helper_task_euid); Aren't these like ideal speculation gadgets? And shouldn't we avoid functions like this for exactly that reason?