From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BA4FC433B4 for ; Wed, 14 Apr 2021 19:50:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 020E86117A for ; Wed, 14 Apr 2021 19:50:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353500AbhDNTvJ (ORCPT ); Wed, 14 Apr 2021 15:51:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234955AbhDNTvI (ORCPT ); Wed, 14 Apr 2021 15:51:08 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7953C061574; Wed, 14 Apr 2021 12:50:46 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id v72so2750972ybe.11; Wed, 14 Apr 2021 12:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KYlm7QJNdb4JnhGTMGRomUPh4aAvt7AdM3SQppwmFQM=; b=NA/LNzHuNEZosNIqBZP0SH2adQEhB6bQguQXseEhYnkGVZyhZfztxieK1rL8LA1N7t rkwrXGd47OGgEb9eAGDaG+lWxyiYDl25LYPH+5/sJ4/d8CaRbRNZZiceqEJGOMXRmIoy br3Q1SsYOEcA1ZtnlLA9u9UDOvG8gNVPg5uiIxIGF/9d8hB2fvtgHGFqSTcx6m14E2CQ +ilR3RNgJJa6QTzd2ZUSZfswKdiKvTxQ+7+OsDzbKhWT0NsbBN2h62erP8YMsuU3vzlJ BCd+V14DEsHqX8ZynYp0lpP8YjZPnArk9Ycz4oZXc0eBK7NZzU8m4j4JX01sZpKOv7p9 +Zxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KYlm7QJNdb4JnhGTMGRomUPh4aAvt7AdM3SQppwmFQM=; b=XhhVPh96delW1Q0ry4Bk5KQIF501dS11ui2aiJfPHAh5P9uawrhJgOwxZJfQDW++t8 3igSS07WuWJJM9ei9QFk0qy+/y5n31VT3jgL9ApM8R2HerR4Sezzzv2oByHE7JcL4Gyb I5sJUIkyQtZqsdPx1LIs6naKD0AOpRbEwv94YGmKLu2Gjkdxst0PENx3b5L0U7G+bl5w 9zBjz7lhHqKge/MH3rHYMWF/6DeflM2xjawkGEX1VnPvuu0zTnkIIVbumPQmRAxLpG1Q 33d8UHfShMxHy4dr2nQ9j1heAG8j1SGTE8h6LNaeO55FiymLst3zAmZVks5DZt7UqDdn /T1w== X-Gm-Message-State: AOAM5312e4JqsKsVrCLyy6O9Axm4jNOy6ia8QddIoxmcudchc5SBdufy nHaeEJzBciyhcPQlyaUPV95hLsYTA90sIDAUZaA= X-Google-Smtp-Source: ABdhPJyc5WdBgAwpcNaT4ZnVDVccWaCGIXvnyziVT2JDu6RWbr+K0E9wplZIpWP5+MopFoA+ItsxBPpTnrjSy7xTFmE= X-Received: by 2002:a25:6803:: with SMTP id d3mr46864038ybc.422.1618429846183; Wed, 14 Apr 2021 12:50:46 -0700 (PDT) MIME-Version: 1.0 References: <20210414184604.23473-1-ojeda@kernel.org> <20210414184604.23473-8-ojeda@kernel.org> In-Reply-To: From: Miguel Ojeda Date: Wed, 14 Apr 2021 21:50:35 +0200 Message-ID: Subject: Re: [PATCH 07/13] Rust: Kernel crate To: Linus Torvalds Cc: Miguel Ojeda , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, Linux Kbuild mailing list , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Alex Gaynor , Geoffrey Thomas , Finn Behrens , Adam Bratschi-Kaye , Wedson Almeida Filho , Michael Ellerman Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: rust-for-linux@vger.kernel.org On Wed, Apr 14, 2021 at 9:31 PM Linus Torvalds wrote: > > Again, excuse my lack of internal Rust knowledge, but when do these > end up being an issue? > > If the Rust compiler ends up doing hidden allocations, and they then > cause panics, then one of the main *points* of Rustification is > entirely broken. That's 100% the opposite of being memory-safe at > build time. Of course! What happens here is that we use, for the moment, `alloc`, which is part of the Rust standard library. However, we will be customizing/rewriting `alloc` as needed to customize its types (things like `Box`, `Vec`, etc.) so that we can do things like pass allocation flags, ensure we always have fallible allocations, perhaps reuse some of the kernel data structures, etc. Cheers, Miguel