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 3DA09C5479B for ; Thu, 17 Aug 2023 20:00:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354801AbjHQT7s (ORCPT ); Thu, 17 Aug 2023 15:59:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354792AbjHQT7O (ORCPT ); Thu, 17 Aug 2023 15:59:14 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F34630C6; Thu, 17 Aug 2023 12:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date:Message-ID: Sender:Reply-To:Content-ID:Content-Description; bh=tBpJv333rbTQBlJ6Cfx2uRqVy4TwIqy7goRRmAqDuS8=; b=aqZtdSbSjnsdYbQl0oIVDXPgNs ZgzrOq+TmTJgKg3vfsq9Jq8l5ukJ1ecPRkkdGGqHGdpG+eOA4wlZP2XtItPh8fSDnzIWFos7+wEvE N+Z1zHtB2hiARaSwTMsED0bsH+DbclH28V2ZTvnfCYomcGVl8dB+qyG2W5sBAur0L344yL3up2SQ8 1dgE87jQJ99gA/mGVUDfH5u0SVjEZaGouk3PedDkzkgTDXif6lZhCpwfplECwpRE1asqw/4QYsGsQ 400WtyeKf4lsgkDn8Y0eflZlOd/sevnrD5C2UGWXeEzYm3u6ZYJc19UCQGorSELLzQVNjA43EiMyE khf6T3ZQ==; Received: from 108-90-42-56.lightspeed.sntcca.sbcglobal.net ([108.90.42.56] helo=[192.168.1.80]) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qWj8v-00EKHv-0o; Thu, 17 Aug 2023 19:58:53 +0000 Message-ID: <4ceaf4f9-ccc1-c0a6-ee3b-a570355d2131@infradead.org> Date: Thu, 17 Aug 2023 12:58:45 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] powerpc/ps3: refactor strncpy usage To: Justin Stitt , Michael Ellerman , Nicholas Piggin , Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Kees Cook , linux-hardening@vger.kernel.org References: <20230816-strncpy-arch-powerpc-platforms-ps3-repository-v1-1-88283b02fb09@google.com> Content-Language: en-US From: Geoff Levand In-Reply-To: <20230816-strncpy-arch-powerpc-platforms-ps3-repository-v1-1-88283b02fb09@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/16/23 14:39, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > `make_first_field()` should use similar implementation to `make_field()` > due to memcpy having more obvious behavior here. The end result yields > the same behavior as the previous `strncpy`-based implementation > including the NUL-padding. > diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c > index 205763061a2d..1abe33fbe529 100644 > --- a/arch/powerpc/platforms/ps3/repository.c > +++ b/arch/powerpc/platforms/ps3/repository.c > @@ -73,9 +73,9 @@ static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4, I tested this on PS3 and it seems to be working OK. Tested-by: Geoff Levand