Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1754110rdb; Thu, 17 Aug 2023 00:36:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCjdBbH7kP1kBG4N5KGLDeNgo6YRXUpkYKn96LkSjk3UHlRN1ufQdwu29KV7ihLWGqW+L5 X-Received: by 2002:a05:6402:2031:b0:523:47cf:5034 with SMTP id ay17-20020a056402203100b0052347cf5034mr3564082edb.34.1692257782484; Thu, 17 Aug 2023 00:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692257782; cv=none; d=google.com; s=arc-20160816; b=AB/v147Q2wTzdUUsHccjukvxZwH8IQoXtczgGY01EIZU3yBpNb+5nq/YXTYCZbdPCn 4Cn83/14OLozyhYspdBnr+OwYLXYEkBrxU4/xV6/vGtjOJxxFSPYnW0ITFYIHNfchNUS 4b60tt+pNjIQd3ns0oBP52PZFkltMe+EqjXw0JdgCS4cqlOb7L05ELshiXjOZCsmba3O VghKZajrEFuvQjCX/N+r3Wrr8Hjj12QM3WBSE0R+/LjV0hQh3wuiHVSk0shtBNVR/5bg 1f0z6jQsiT9zhyV+jGW7MyAAexx0R7NZffS33MpOJk4Tu/xUfoczOVfWu223ikwt750N 8qrw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=If2b/s4Fu4pg/ToJMjH8sQQxdpdDFeSQ6X5jvEz5Ybs=; fh=7OUzDKEI0zAvqUCylDGuNbnywUaW0rBdzmyyfJFIasY=; b=mJsqjAJQI/uEVsPLQqKKbL8QXR/ewKsjAxOu1NJc4MbPpLO5mFK0zBrTB/AzM21rIN TJtSpAG0XzI5D86LPodbKWF0Mc37z80fnrMzrxVZk5Pz4994g7uykCfTFxKLMwsV5XDS 2tgmMWJomQ/1Byoxb51bWeviTnCDY+FaWYN3JTjRr2C06qa2g/w5vm7Bsv18SVdOtzCL 9/aufSwkqRr/GqAv3A1PMl6JmxJljsNoIjuP+nl/Mo7V0xWV0OSn/wQquHcDR8K7OZ4V EZtHxV7cdL9Z/esLcRmREy4S8VuuFViIheYQeIrbLz7Ie2mJBnC1n5NlDFIcXdTFABf4 UmkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i1ePwHAK; 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 r5-20020aa7cfc5000000b005267b79676csi832548edy.389.2023.08.17.00.35.39; Thu, 17 Aug 2023 00:36:22 -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=i1ePwHAK; 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 S1345508AbjHPS0B (ORCPT + 99 others); Wed, 16 Aug 2023 14:26:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345559AbjHPSZs (ORCPT ); Wed, 16 Aug 2023 14:25:48 -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 072DC1FE9; Wed, 16 Aug 2023 11:25:43 -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 8E20F608CC; Wed, 16 Aug 2023 18:25:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7371FC433C7; Wed, 16 Aug 2023 18:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692210342; bh=PGLvjTPGnQm+GROAgyXYshu3/VEJnLo1CpFsWMm5OQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i1ePwHAKuvO39X60Ic9NYicW9DGdSAWc3HSsZZPLLLwS/o3NB+keVCGwvhIbSy3yP nonlABvnnxyalZrL0LfyoQ2MnC8kCLKTP6itI4d7FRJGmBpIi6BX/Hir5Suf2OTES5 C01ATOtVAOgSWvVfl/BsaA8NhVeB2LvNyR/vFGdkMvUsShbnbNZ3Jt4/QAnjV/6H81 XjSgqfKJRaIthMdZG5gwVVEibkYFpYZnw8qNLA39XDA+H0vG+8L0Xg8JSZL1j7D/to zfltabRF5CU7Ufy97t+gLJGnfH256UIY4dW0PrfAJxCNE8xGIBxvH5Ycy7DHhbDJQI JgPlYD5Ql0z3w== From: Will Deacon To: Catalin Marinas , Justin Stitt Cc: kernel-team@android.com, Will Deacon , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Kees Cook Subject: Re: [PATCH v2] arm64/sysreg: refactor deprecated strncpy Date: Wed, 16 Aug 2023 19:25:26 +0100 Message-Id: <169219745619.1953789.14665350088563020811.b4-ty@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230811-strncpy-arch-arm64-v2-1-ba84eabffadb@google.com> References: <20230811-strncpy-arch-arm64-v2-1-ba84eabffadb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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,URIBL_BLOCKED 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 Fri, 11 Aug 2023 16:33:51 +0000, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings > [1]. Which seems to be the case here due to the forceful setting of `buf`'s > tail to 0. > > A suitable replacement is `strscpy` [2] due to the fact that it > guarantees NUL-termination on its destination buffer argument which is > _not_ the case for `strncpy`! > > [...] Applied to arm64 (for-next/misc), thanks! [1/1] arm64/sysreg: refactor deprecated strncpy https://git.kernel.org/arm64/c/d232606773a0 Cheers, -- Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev