Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1479258rdb; Wed, 6 Dec 2023 23:18:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IEJYHnsNf2TEqUzFD51Em5sU3AhO/u+xJfB9quk1sM1fIFgXulpKgEa5aWOEU85e5DsqRIY X-Received: by 2002:a05:6808:1387:b0:3b8:b063:9b53 with SMTP id c7-20020a056808138700b003b8b0639b53mr2425289oiw.69.1701933533108; Wed, 06 Dec 2023 23:18:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701933533; cv=none; d=google.com; s=arc-20160816; b=NBRnKcAIseCU3qy9iE8RHQ78MoWWfwTw4KJo8LDob4/toKC5sSh6Y22Hj7sTZVWGg9 gTFo/4X5SXpYLeIJaHwHr9KNn2RszN2RALmN5nQQP1HCLy+pRKp0/VX3SRVIE7TXvwNm ++KOQSFM9HGreU3EmixOZ5zhCghs/X+FgDdP7i5TRq+CEICj+MIrgFN+3usITMS1mLes Sw/Iu2Xy60t9ewATGW1yCv0Lt8cRLT55rdw0Y25u3NuOyJ6WDQqt001TWgOebATNelbI MwM+AhMXuTUJV/VXppOElnBBknxD7yeC5dr2oSGvncpocvzIPV/j0+QQSIxPECGLKUI3 wwMA== 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=qCA2GMyPt9cV2w/mPt2FTHahrJT8cHBW3JkHPi3/pDk=; fh=j2N3SRAGrUf0MOLJ2QA9H0CAH1bQkCy15+etu6l7MEg=; b=kesRPuiRdEPzm5xAVsYOpzl8AtArzZfNUolsBuBuL7GRfAdt80TO0plvJ3Gfw1NcIX LGM5dBTrw/Nzdo9hFjYH7fHhbBumAq3zRbkcyZL5E2tKEeKEwX1d12QYnhFf+hA08WX6 qSVf0VYhPkaJsq+JXN/VlpbuGgrF8Gtu7/R4gTX4Uqlz2BRGxQVJCXCtms+BH0xcPeu3 ZREklxL71AaOSz8ni321BvwBKvrhWH5Z39WwHDD+xrlXrZZuQTUKZQwxtyBVDt/d3sr4 uEzrvhZOdU9oo5nOwuGugbYfUhk6i5Za1JwZJG6jpoUg6wT52w4sP1PGMOSmMybuW9fI PEQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H2h2n9dZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id bi11-20020a056a02024b00b005c66af62bacsi748592pgb.174.2023.12.06.23.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 23:18:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=H2h2n9dZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 480D980FC145; Wed, 6 Dec 2023 23:18:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229660AbjLGHSg (ORCPT + 99 others); Thu, 7 Dec 2023 02:18:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjLGHSf (ORCPT ); Thu, 7 Dec 2023 02:18:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B5921AD for ; Wed, 6 Dec 2023 23:18:41 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19EDAC433C8; Thu, 7 Dec 2023 07:18:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1701933521; bh=BF7TDxqLcMq2E5qMJ/3ynCjfbn2PALtyLY3w15WsBCY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H2h2n9dZBOw11c1KhkrPCGR4LahCXbV23f3FC0i/A5Ot2FwlBomGl8d4yimN/s8K3 ezr7ew+vPcraIlX4Nz1QzjJQZeflJ2Mk3W6alfE0FQ54b9JjRs7eJLliBHCEvHGU7q bW2a3bRZ8k/qFYlCEjRJVMjIaL1160Zk0mK8jGPM= Date: Thu, 7 Dec 2023 08:18:37 +0100 From: Greg Kroah-Hartman To: Kent Overstreet Cc: Peter Zijlstra , Alice Ryhl , 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 , 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: <2023120716-ferocious-saffron-c595@gregkh> References: <20231129-alice-file-v1-0-f81afe8c7261@google.com> <20231129-alice-file-v1-5-f81afe8c7261@google.com> <20231130103635.GA20191@noisy.programming.kicks-ass.net> <20231206200224.rkdkuozztzg2wusj@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231206200224.rkdkuozztzg2wusj@moria.home.lan> X-Spam-Status: No, score=-0.9 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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 06 Dec 2023 23:18:50 -0800 (PST) On Wed, Dec 06, 2023 at 03:02:24PM -0500, Kent Overstreet wrote: > On Thu, Nov 30, 2023 at 11:36:35AM +0100, Peter Zijlstra wrote: > > 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? > > I think asking the Rust people to care about that is probably putting > too many constraints on them, unless you actually have an idea for > something better to do... It's not a constraint, it is a "we can not do this as it is buggy because cpus are broken and we need to protect users from those bugs." If we were to accept this type of code, then the people who are going "it's safer to write kernel code in Rust" would be "pleasantly surprised" when it turns out that their systems are actually more insecure. Hint, when "known broken" code is found in code review, it can not just be ignored. thanks, greg k-h