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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAB89C00140 for ; Thu, 18 Aug 2022 17:06:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344404AbiHRRGf (ORCPT ); Thu, 18 Aug 2022 13:06:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345456AbiHRRD1 (ORCPT ); Thu, 18 Aug 2022 13:03:27 -0400 Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 873CCCB5F1; Thu, 18 Aug 2022 10:01:37 -0700 (PDT) Received: by mail-io1-xd33.google.com with SMTP id c4so721873iof.3; Thu, 18 Aug 2022 10:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=T7igz+JHo+DrCDKUS4xWUJ3/Lp268Fiqe+ivN8o+tCA=; b=mSmp9rHtVwSbvQYUCcl1B6+4w12c4NZupPfwhitjKwp64SgVF4OpQZTM5OjLoTUTq/ bvlbPn/LMeKbRiglU8JNMoyfa9evwumI8CLFupqetQdHEK6ASSyTUQKMARKS6+J8d41C syh/FDLqz69ZOMnbwXYSw27NnA/SdwWXPsCZG/OkbTJ3TeRryGQaM9pefDmG20OB855W Pg/ZEny4IK0cVtgltjxaukuxnPCqRSVwGGN3R+gsz1dnG13VOb8meRsL2IYZz+ic/ZYT 3+DVKOsefTIeUcl4hA+wuKfu9fKsVZ5i0F7XDoWk47lyfxro942KIc/TnSD31+zljHZs 2m+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=T7igz+JHo+DrCDKUS4xWUJ3/Lp268Fiqe+ivN8o+tCA=; b=ZiOJYSEqIf3HoypENj/fCoR7hClsGJda4huvMVs1yEbErtAQ7OylVNpp8b5Vxf0wlX kELR6LhttQ2icRsbEONYu+MV1LH6d8qq4vfPpJBx2SGNifDkgv+fbjiU3ypUvLBUya0c Xa3BTU1gwSZfwrc9oASN8vSru7lwmFsHLRmVkN4sFddieNLL8LVP1HbPSZTIiNekYRGm Dks9nU7aCnNSk0dGpTk1eXy2/HSIrvE/gOE1MRwWv3FhExSTyvJuqlERLN94yNMxBwBd ORkNdzONFGyfJ9k85qCf/Q+FTVRGax0evzlEBLePRySWTaveYEoHVxFn7z9i7CwLlk1t iqQw== X-Gm-Message-State: ACgBeo39bUsoEvVV0rrIo7F0QjrD8DYf2p/a44+JqamBJSNuf7TJ/7i7 wHa1+nNhGQAwJu6VnV0KRbzpbg8jkcnR5LC0g9Q= X-Google-Smtp-Source: AA6agR5ue0JYy9T5byXdp26N17IarelQjKYAQisDC3hxB9tZlGD0vKInrJQ3a9Wk2MjOxtbHTGvUCzfa3vGBxwGqww0= X-Received: by 2002:a05:6602:2a42:b0:678:84be:c9ec with SMTP id k2-20020a0566022a4200b0067884bec9ecmr1767428iov.64.1660842096984; Thu, 18 Aug 2022 10:01:36 -0700 (PDT) MIME-Version: 1.0 References: <20220805154231.31257-1-ojeda@kernel.org> <20220805154231.31257-7-ojeda@kernel.org> <202208171240.8B10053B9D@keescook> <202208171331.FAACB5AD8@keescook> <202208171653.6BAB91F35@keescook> <202208180905.A6D2C6C00@keescook> In-Reply-To: <202208180905.A6D2C6C00@keescook> From: Miguel Ojeda Date: Thu, 18 Aug 2022 19:01:25 +0200 Message-ID: Subject: Re: [PATCH v9 06/27] rust: add C helpers To: Kees Cook Cc: Miguel Ojeda , Linus Torvalds , Greg Kroah-Hartman , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, patches@lists.linux.dev, Jarkko Sakkinen , Alex Gaynor , Geoffrey Thomas , Wedson Almeida Filho , Sven Van Asbroeck , Gary Guo , Boqun Feng , Maciej Falkowski , Wei Liu , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 18, 2022 at 6:08 PM Kees Cook wrote: > > Please, no UB. I will take a panic over UB any day. It'd be best to > handle things with some error path, but those are the rare exception. > > C is riddled with UB and it's just terrible. Let's make sure we don't > continue that mistake. :) I definitely agree on avoiding UB :) > The simple answer is that if an "impossible" situation can be recovered > from, it should error instead of panic. As long as that's the explicit > design goal, I think we're good. Yes there will be cases where it is > really and truly unrecoverable, but those will be rare and can be well > documented. Yeah, that is the goal and we always take that into account, but there are always tricky cases which is best to consider case-by-case. Cheers, Miguel