Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1450254rwo; Wed, 2 Aug 2023 14:28:44 -0700 (PDT) X-Google-Smtp-Source: APBJJlFmdmRAAErBAFwn7qCUoERKr8o2MFYTUX8DxAfry6UOCSPUSv68CrJGkf4X1BklDZoD8Zi3 X-Received: by 2002:ac2:58f7:0:b0:4fb:8359:e8c with SMTP id v23-20020ac258f7000000b004fb83590e8cmr5064577lfo.34.1691011723731; Wed, 02 Aug 2023 14:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691011723; cv=none; d=google.com; s=arc-20160816; b=l1nhquAWDWE3+YehHwSKHQgNroXeOR90lbD+FL4mK5dr/E/GiSUj73zPxBrZ4xuHXr z3XdrwG0kzt7cWKS2PRB0yXeqJEO5dQPawBUmdMf+fZIQBuB1yrcwVSSJmexL3QsmFfB s55yQcCkR9G71hb2IMWk4LwA26CEnemiFj75WS9dScjkhIyCNolwnUTDf7X5sTNM6SQ0 uR5uVIyl8nMv02pKtaCESW42wLAXH3mjbNkU2INCHs8oheucTkabqxZL/MLHxnvodipy Gt/qQpIZkKlynT+6ELwk6Xjm62XXGpVbuVhcIqOunAchJmFTLZOhzTrUWGLrRCFigxyn H9cA== 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:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature; bh=QGHTYpelyksOoosZP1Ziw23+7xtR/zfyNroZdZ17L5o=; fh=690/Zb57AWHV+k8KhVHXlgvVUyBjmWUZVs4WQXaT6PQ=; b=ZjMyr822dk/918/uibvgNsGwB3Yym/kjJFVAdLHsXIjZ6AfZ0VwZF7oLDCZuZUwFR7 2sq1WfmtVP0ZVsi1co7jmTXumZvWjFfqcsQlgp/e6w1v+kuEwGeFahrA5yOAkKqcQyaf hDS0OrLU4Ay4/emxK1XWZt6VuNGhcL8GqmKiB2fftGrfRNOm5QAkKVMd1LCSC+UazPdn MvejP+54aqN7WQpcw4hqCfa7x5B2iqzpZ6XJXzQ8HlApUDHtV6Ut0S0c3thObJwToGRD egTUzkQozKh6vyBeX2Zi7pDxeBqhGfTpyek6AYyuejCLNfa4TvZsdDpGxylnuyB/0vim EHlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mq5WI9NJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z12-20020aa7d40c000000b0052307545125si947278edq.635.2023.08.02.14.27.58; Wed, 02 Aug 2023 14:28:43 -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=@kernel.org header.s=k20201202 header.b=mq5WI9NJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbjHBU73 (ORCPT + 99 others); Wed, 2 Aug 2023 16:59:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjHBU72 (ORCPT ); Wed, 2 Aug 2023 16:59:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 928D5E57; Wed, 2 Aug 2023 13:59:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2779461B07; Wed, 2 Aug 2023 20:59:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BE3AC433C8; Wed, 2 Aug 2023 20:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691009965; bh=nmkOzzBtFOlR8DFxoWtwW9LZ+hvtWnT7U9XNNbK44zs=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=mq5WI9NJKx4ot/fCX8urwyDmjDYxKzJ/KxXHIauxGNMqx+Wn5E6rCeWejmb1+uvPu 2sXo1C7LxMcElPtGGXkI7IhP7dbMYxBd4Rbm1BOI8f+xbAPOS2669DZdz2NpgrelaL OBW8EcwJlyz+Hg+099ccKwzdtQ2m8SwyZaawbdbGwdVXdHnjHWVdK+QIfKDki89yFJ ePhMHIaQxen3fGEoxnjavTGdFAq2J/mI25pI3/uZbtY+1nj8le5+zUSmt3j6cdgVAI IwmBY7ztrTn+6dmuZfFLVGIXJMsZcYlP9LNg9W68X9KEJF7GQ/SbQi54Pkj4C7h7AD KgMPCWGiYpMwQ== Date: Wed, 02 Aug 2023 13:59:23 -0700 From: Kees Cook To: Palmer Dabbelt , keescook@chromium.org 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 Subject: Re: [PATCH v2] RISC-V: cpu: refactor deprecated strncpy User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <6A03714C-8C92-4E05-8FAD-D2C5A4745E7D@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 August 2, 2023 1:47:14 PM PDT, Palmer Dabbelt wro= te: >On Wed, 02 Aug 2023 13:41:52 PDT (-0700), Palmer Dabbelt wrote: >> On Wed, 02 Aug 2023 13:36:03 PDT (-0700), keescook@chromium=2Eorg 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]=2E >>>> >>>> Favor not copying strings onto stack and instead use strings directly= =2E >>>> This avoids hard-coding sizes and buffer lengths all together=2E >>>> >>>> Link: https://github=2Ecom/KSPP/linux/issues/90 >>>> Cc: linux-hardening@vger=2Ekernel=2Eorg >>>> 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)=2E >> >> Reviewed-by: Palmer Dabbelt >> Acked-by: Palmer Dabbelt >>=20 >> If you wanted to take it for some hardening thing, though -- otherwise >> it'll likely end up on my fixes later today=2E > >Sorry this is for-next as it's not a fix, I was just looking at other=20 >fixes=2E It's queued up aimed at for-next=2E Awesome; thank you! :) --=20 Kees Cook