Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2187639rdb; Mon, 9 Oct 2023 16:15:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGFqsQjjIqqJTzVtcQqDZtQjdmMHWEUbJjjRIjpkWCv8x+Odf8C16SsYWs6vfv5Ot6aHdat X-Received: by 2002:a05:6a20:2445:b0:14e:3ba7:2933 with SMTP id t5-20020a056a20244500b0014e3ba72933mr16597873pzc.54.1696893359169; Mon, 09 Oct 2023 16:15:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696893359; cv=none; d=google.com; s=arc-20160816; b=X75/kIP1mveSbDORJic6G0kflTrrFBMmCWMVuxiROW143o9aOVy1OOUJHoSyc0eJxe KJGfuag6QLM/pDilEXL1XmDqbM/zqqFvcOFHDR2Ykcc06oPDoXAEj6vlZLmhktuxxiPr hM5fl2TFau30DfcI7y4e3Z28sSMaPebsk4z6cGFqHNiOSs33+FU07KAd4qw+iAgW3+uD ZyUsvCVSVawvGJfgdkYdnN8hWtbWx3Bj5l8kk+VP6mZkneagb8iT9VeINAYgfIw+V3ec yPNlW8SHY6Rg/7ctmz65LDscJ2M/QRegOK6PQHGVhiw5N4HrR9YZqcIvSACrkggQ6bdi Hh6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=cBvYA2ZtciSSP4BymFX/zrFacKuKzAMWo9vVUVhdRHg=; fh=DFEFobcMw3NaGuWAESkbK3twPBMJrR083hw++I7BQoA=; b=G74rezvbuprPGjmTQ9QKBpiIukqwQ+l4yNr+JluowEWPvLeKjiCOGZHTynzGqWelbj zHqBkzSWL2wf9Lp3n9iRfAbIYQGFrjj78/j2SEOc+ALiPBJSKWnAfL2q9BS3cg0RPTkj I6Z7GIC9VQh6ZThuRxdoo9aq60R8F5GTccYG+UtpOl8a4+umvCrprDu/NDLaszVXxCQc yKaocDoUsucGKOnWdqVLuMYxjU9AKnvAvZvqNcHzLuKp+Hp+/K3TSD9F/CAw0E9+mmWa 5J64x1ORFuAZxGOdwUOBGgmuMmHwZ2oYeSrwqmQKnAbPZqijGiX2HlbfNPpxcpJ+w2Q3 ccfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hLKRPo4T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id z6-20020a1709028f8600b001bc74f6a951si10231801plo.250.2023.10.09.16.15.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 16:15:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hLKRPo4T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BDFC080842C8; Mon, 9 Oct 2023 16:15:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378998AbjJIXPU (ORCPT + 99 others); Mon, 9 Oct 2023 19:15:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379068AbjJIXPG (ORCPT ); Mon, 9 Oct 2023 19:15:06 -0400 Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D72A26A6; Mon, 9 Oct 2023 16:12:10 -0700 (PDT) Received: by mail-ua1-x92d.google.com with SMTP id a1e0cc1a2514c-7b5f0bbe137so216991241.2; Mon, 09 Oct 2023 16:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696893125; x=1697497925; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=cBvYA2ZtciSSP4BymFX/zrFacKuKzAMWo9vVUVhdRHg=; b=hLKRPo4TtZv1TluLN/cfBRSLpkEwYaTe2YKxDyH90OfaR9I9Y6O4M+QK38lg7aLzMH B9KWV0C0HIUkQTKj2RLxVYYaHLXHLoQUWtNwI5GFy2NwQ8TyHGJO6Ybqmeom/u8JVl/d IMXjXRvUEORFR6DPvrlnsL6T7ESGUAWXkh2SPzTUv+01BS7Yj0IFUBmjEAdq+FrD9AVP 2inr3yRipughj0eH3UVSUmm5HRh1tffUvG9orn0C9jCy27JKM6Sy/Bn4fx30UbDGDdH1 6hxB0LxWDvFaMVA+6weKeLhL/1FDojje4vqyDudi0tDrljaY9rb/ZC4XPWFDIz7VjQur cSXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696893125; x=1697497925; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cBvYA2ZtciSSP4BymFX/zrFacKuKzAMWo9vVUVhdRHg=; b=Kc/adbFYEo7eoC759FNa7SvvKmT60bWN93G9IC3SYG59jZ7OjJqQ0rvTwtxxCrLhMS TRoDUN/IwPJ7yGmwqhMTUGdLf/KBx8NmQCDTiWVa4vPZ/gm4XSUczQatMPj+SC8AUbze dNS774De3CNfSlJKcCTGzuWXnpqURpZAiqMA1RxZpFLf/8EXFP6K5DaEbOZpq9NGD1ho U2Y+EWS/D8y/JUNn0+M905wpBrJPkEDGaG+yie3SECrtv84F5PQMT6hOjYgMdWWdCwMj D/iioJkhLoDOb6+FlAHdMKxL1sJWgoHqRFBgQT/s0m6ymbM74f0LwDKupVD6Z2/7V7+5 5LXg== X-Gm-Message-State: AOJu0YxYHhm4wRCR4hhqgtuUZFnObcQkw2drcGedl+yTtz8kkIlIVAKn /RSoBEvjNek8LclB6+mbLHw= X-Received: by 2002:a05:6102:3a76:b0:454:6dc6:cd5e with SMTP id bf22-20020a0561023a7600b004546dc6cd5emr15136006vsb.15.1696893125521; Mon, 09 Oct 2023 16:12:05 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id s27-20020a05620a031b00b00767d572d651sm3874915qkm.87.2023.10.09.16.12.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Oct 2023 16:12:04 -0700 (PDT) Message-ID: Date: Mon, 9 Oct 2023 16:12:01 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: fec: replace deprecated strncpy with ethtool_sprintf Content-Language: en-US To: Justin Stitt , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-hardening@vger.kernel.org References: <20231009-strncpy-drivers-net-ethernet-freescale-fec_main-c-v1-1-4166833f1431@google.com> From: Florian Fainelli In-Reply-To: <20231009-strncpy-drivers-net-ethernet-freescale-fec_main-c-v1-1-4166833f1431@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 09 Oct 2023 16:15:36 -0700 (PDT) X-Spam-Level: ** On 10/9/23 16:05, Justin Stitt wrote: > `strncpy` is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > ethtool_sprintf() is designed specifically for get_strings() usage. > Let's replace strncpy in favor of this more robust and easier to > understand interface. > > Also, while we're here, let's change memcpy() over to ethtool_sprintf() > for consistency. > > Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1] > Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2] > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Justin Stitt Reviewed-by: Florian Fainelli -- Florian