Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1498122rwo; Wed, 2 Aug 2023 15:24:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlHXsTPqXxDDh/cAyrzUY1nZ368j6S0i3KQ8opIbhhJe7fQF4upvGIxSgfBUlfYgtZVnVjmN X-Received: by 2002:a2e:9097:0:b0:2b9:e304:5f83 with SMTP id l23-20020a2e9097000000b002b9e3045f83mr5662285ljg.26.1691015056598; Wed, 02 Aug 2023 15:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691015056; cv=none; d=google.com; s=arc-20160816; b=v6Gqt/p8kJVowysWuarkowbf3TvbisaSA3qqThQzJXIc/jme+qyivMhsvTz/jphLUr CnwA6HNHYHBnp/RM5CvJzrU5si346VkTx5hbEzA74f5SdqFknDBgG2Hb6ktAzMTogKvl wNbKZeRtdZO8xpoamk0l4tu1pcfsx466Pfr2wCn3sqlT//X1pXdFPMr/+1YASdBom1/k hJJbuzAWmUGhHLLc3kR8Vwb/libb1bp8BQfSdpRKhVBL5ze2I6mKRyurRjoAu+C84Dmk Q/f+owCFYPU2+Akoe6B3mFYFMkymYV8XVoXvC5GZRaB8lnJnaqemW8tA4lfYJrb1/JMU hxZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=XOTW7tSWYTyx7UDF6T+TXg8EIzNOXTAibUlBcE38vs8=; fh=4bdsbghwu+F8+8nuhaxtiZe/7ZMgm8JFZTYpOiBHuqM=; b=pZusv/dSqrXygCGy+/s+AYbqDaF/KTb2D2sNSLnaPvlo08kZbAObuFBD4JR75oGdKv Yozj3jdetnwdCAu5CCLiHvSyUpSri1VRnvhqQC3enBG+UfZ3ALkmKeLzUwQejZyixqnp 6LUxJ3+SdV2XGeIPzZC0kJDb1qWUvn4ddamvaT9KpgW0rpCmPO7FxcVIQJW4R+iT69gn KDya2ljpFEvOFcfJQPRypMQQdvZmYzsxW4f0bpougg7EdmA+g6ieerdmJ07XcV89WXfN IrsdnCIWIQAPgmJBzfT9xnqJs9GMUrBWQzbIXKwYOjwdeur+HCErdR1tkMyrgLfEWmLN hFSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=NG+5rMrh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k22-20020a17090627d600b0098d807c0e8fsi11178540ejc.264.2023.08.02.15.23.51; Wed, 02 Aug 2023 15:24:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=NG+5rMrh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230251AbjHBUl4 (ORCPT + 99 others); Wed, 2 Aug 2023 16:41:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjHBUlz (ORCPT ); Wed, 2 Aug 2023 16:41:55 -0400 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17383171D for ; Wed, 2 Aug 2023 13:41:54 -0700 (PDT) Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3a74d759be4so133655b6e.2 for ; Wed, 02 Aug 2023 13:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20221208.gappssmtp.com; s=20221208; t=1691008913; x=1691613713; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=XOTW7tSWYTyx7UDF6T+TXg8EIzNOXTAibUlBcE38vs8=; b=NG+5rMrhgt8ajv9MPHJRkksDamIASvOjqTTUPHyRoobNVDQSWi0PwWWph2HSzMcdMl A9HE9kmImry6AtWp2gUbGM/jK8r16N1j7DiuzIHODeQu+mzVZ4Nc5x80Zx5JkiFmSnHO uOPUvvmMKURIHUCoWtfp9Rlg7pLfP0EZa3t0rZOpEmSucSQRceq09vtlxx1NioyJNNkD 4fSrS7ibFXvZGGzqE3oJeBJyMSPtz7hFdkn4SO1BzNbBZRtfBvnbzCIbSBnhKY/50gMF g9/Y7yRXXe9yhQWo6eyNbq0BU8fTMdr0BTKZOgC0cNhC2TxijnG1xbfqy5nF/bsinVyn 22ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691008913; x=1691613713; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XOTW7tSWYTyx7UDF6T+TXg8EIzNOXTAibUlBcE38vs8=; b=SVlngyB8ZRiUAjDWngkavif4tz90ailra/X2SenSaHHpNoSJyxm7gDNgVuIhiHBNwH jUO7LAlqvRqSYSOOgw3BFYv7FyvXlwaJPeoC4eTBWTV+nNQdPkihBW3KkAvL3DasGi/2 kya1eASfS8jVEmYTrukxnvEEw7wucFco/agBa4kA0/75sMeuJF/F/issahCyjfb2VeKW LZqNXE6xLs40jxvSbk6KZBxHB5hqtdk6ShLbXWf6+XbG4zh+vJ+Cx0R6IUV6feYWMBH1 gkhs03xM9YEHhSpVjLHoFkEs6za0ggMzYQ0ZVfs8FxfPQonbuPLAE3M+HnV1bZExL12Z TC5w== X-Gm-Message-State: ABy/qLb5MCZj6t21KEy77vDgSNfAhTAioiTPxfaHVFwnMX8ce11WAezC ky7pSLGPproro9ocXTA7uBm1Uw== X-Received: by 2002:a05:6808:21aa:b0:3a3:dc0e:4d0f with SMTP id be42-20020a05680821aa00b003a3dc0e4d0fmr20856581oib.22.1691008913338; Wed, 02 Aug 2023 13:41:53 -0700 (PDT) Received: from localhost ([135.180.227.0]) by smtp.gmail.com with ESMTPSA id l4-20020a63be04000000b0055386b1415dsm10930827pgf.51.2023.08.02.13.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 13:41:52 -0700 (PDT) Date: Wed, 02 Aug 2023 13:41:52 -0700 (PDT) X-Google-Original-Date: Wed, 02 Aug 2023 13:41:50 PDT (-0700) Subject: Re: [PATCH v2] RISC-V: cpu: refactor deprecated strncpy In-Reply-To: <202308021335.8010D08B@keescook> CC: justinstitt@google.com, Paul Walmsley , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, ndesaulniers@google.com, linux-hardening@vger.kernel.org From: Palmer Dabbelt To: keescook@chromium.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 02 Aug 2023 13:36:03 PDT (-0700), keescook@chromium.org wrote: > On Wed, Aug 02, 2023 at 12:21:58AM +0000, Justin Stitt wrote: >> `strncpy` is deprecated for use on NUL-terminated destination strings [1]. >> >> Favor not copying strings onto stack and instead use strings directly. >> This avoids hard-coding sizes and buffer lengths all together. >> >> Link: https://github.com/KSPP/linux/issues/90 >> Cc: linux-hardening@vger.kernel.org >> Suggested-by: Kees Cook >> Signed-off-by: Justin Stitt > > I like it! ;) > > Reviewed-by: Kees Cook Thanks, I just queue it up for fixes (might take a bit to build test, I'm a bit backed up). Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt If you wanted to take it for some hardening thing, though -- otherwise it'll likely end up on my fixes later today.