Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp358037pxb; Wed, 14 Apr 2021 17:44:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc1aSyAKRf6999EuOZ31BqupFy6p1vzmzPpHY6H39Z9sEVbV90OechbOWMoQ763DS9ui3G X-Received: by 2002:aa7:df13:: with SMTP id c19mr1000350edy.370.1618447485563; Wed, 14 Apr 2021 17:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618447485; cv=none; d=google.com; s=arc-20160816; b=CipGrN+6miMcthvaHZBOjnk2DhS6U5Nosi/Fzd5OZ1xHnimSmoUyMXMr8Gym6VKatU ZQmZGiAD7hKsYqofzedHA0B2tY+Bf9+Ccok6te+efwECYnD12rsdJjoFcqUPzbBqeZ6u DQQrh0a6V8+RGluolDb8Y8zzPRVhsp4nAk7F1m4Tazp0gkRUc7Op9k7kYJK8VIoYgkyT UoGq4eX+STBoUQh5CjG+rat5kIDxeJTtIxP6/nh42ae02oxdKcDCo6eu2pQHsC7HpMS9 6YmORweUrFADbmiNatXQPaVIHsv4i30j7oyt5Y4r0p1BOmu9Z0FJ2B6mT8Y2QRXGYzzx YMcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=KYlm7QJNdb4JnhGTMGRomUPh4aAvt7AdM3SQppwmFQM=; b=KXtS9SgAvgvAxtcCtG9xV0Aa+TRf4GIyVKm1qqK2gwpOLRUmBG1b5ABJNI6LIItDBJ z/XVXdbLoeeo+u8XZEBhdzZyEqV19dRAY2rWqOmrhfDQbkYyy8dDKIQR/F6ezEKqhXB9 ZwFMDKzccWGjmryEY94HrSaRx1mzqwAeWin/6S2juiJ+WNffpkQZ2BLoO66gELqPeSp9 tMZg14joMFaYCkecDBCTyrwisissFBijWve98hA/zKgeDCXusiUz1kQKVfYp4JRtsfYr hi2HbA2ODzIbzKnuTuK/t6JE2tFRUF3/9DTQ+WVQDiNnA7guiIItc95LtJs59jrUVT5+ 4IFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="NA/LNzHu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rp20si783312ejb.524.2021.04.14.17.44.22; Wed, 14 Apr 2021 17:44:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="NA/LNzHu"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353503AbhDNTvK (ORCPT + 99 others); Wed, 14 Apr 2021 15:51:10 -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-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: linux-kernel@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