Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2126554rdb; Mon, 9 Oct 2023 13:34:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFPmxb7w17nnXddsJIIleEpMltKxYLr2n8qVwXBB/OpaZLErMNrG8/OWuxNo/0b9yN9xqQF X-Received: by 2002:a05:6a21:2724:b0:16b:74db:8fde with SMTP id rm36-20020a056a21272400b0016b74db8fdemr10002797pzb.61.1696883647410; Mon, 09 Oct 2023 13:34:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696883647; cv=none; d=google.com; s=arc-20160816; b=StLc6bzIYKKlq4FRd+kQyiP5jwCiNZooLxULuBFrH6m7yOf/nBluOg/TzvYKzeViLP VV48VYweZHh6Ftk33zNqW3vGb6SurR464U8PQD4OsVpRl6F/h0k2/WlnRGjKkN1htuEg OnoJ7rcsbmLqupKvH+8mUj6XKwQNeJImDKcJ7fKl8tpN/5wco1Ohy2rD017KCwLr1WH0 yFZOuASyofAs6UVFqDT3mxX+Y1xLtP9/EPeASlaWv/hJsxi/k/ypnDN9QG8HgATgAM2Z 10OFdA8Y0OzsZBHj1nDTB20M1XxuhDEU4MtqTnUYGw4cw5R6p201FzRPJK4k1NjWNtFf Sxig== 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=aFyxHrkkSeD43XrBLiZbcCrIw/0ZChIaDY1vJYsvFSs=; fh=t/I6oAl4tfuDAYboPpUP6RW8a2n1Bz72rdOcUchO1kA=; b=nPj1q9Juv+hf+ARzZ5t3ls2/e8u/KzexRx/uI35L8N3MWGw5IA9OQQ1uffXS91LLKb amYpn7ajhLWyEhtrAovu8FNdL/QyglIP82+mRmmQtp6ANu4j5fhNk8fxqrrD4eKCdvM3 u4ZFEmZYF2rjGwtCpUVAJI+c1kumQVo9ORxM/I1cSWxFRfrSQMmlya2lxH9X/Q0/UOkO Ur2zdngu1Aomt8RJjaKuP6Ovy/PxQiEPAl5JBhDrD4RfzUgaIVwrK1ZtmS7LflGunjsv Py61llcn13c9l/CTzVD6fzRLDTlzQfo8DbVJjkDXoc385QK1H6+yypJ0LpAfak5Y/gUs vE7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mgwC3RyT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id by9-20020a056a02058900b00584af3ee495si11906126pgb.623.2023.10.09.13.34.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 13:34:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mgwC3RyT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id F029280BB514; Mon, 9 Oct 2023 13:34:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377872AbjJIUdy (ORCPT + 99 others); Mon, 9 Oct 2023 16:33:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377916AbjJIUdv (ORCPT ); Mon, 9 Oct 2023 16:33:51 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 109C1AF; Mon, 9 Oct 2023 13:33:50 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-27b13d586beso3961861a91.2; Mon, 09 Oct 2023 13:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696883629; x=1697488429; 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=aFyxHrkkSeD43XrBLiZbcCrIw/0ZChIaDY1vJYsvFSs=; b=mgwC3RyTiaEhIWyCDk4gIF4vkN6GVGeK+ZypfR9uCf1HLUkwVdjR1WYO7U0esn3CKM wSQmEoHrC513FR5XQ+5pzi8RfyWi2AHbc0nSJHZduCV9e+sRVxi2wgpJURgBb1tGeIYM vX35QX4MpQ9rOjDqSs9wrAOGw/QbWrYIp6c0PJe2Aq0M8zjTL9+NQiy6TXJj9N6otucz 9Uxy6ZRrrSSPcP7x0KXlBFAGXfDdDzajQmF9Mo9LC5r1ZC9v+Q7evtvK/BObRs82oKXe lNxbrz+J4E0rckLo4pUPsdmAMFHEPPWO0RiLeATAdAE9NAgNrs1YoMtUvwMVmX5euvps UY4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696883629; x=1697488429; 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=aFyxHrkkSeD43XrBLiZbcCrIw/0ZChIaDY1vJYsvFSs=; b=RnA4Ee55aDILbDqtLYDQ1l3Ly6TiaH2zceFWqSdHwnfCNZNiWzvXi4/6yCziaz9s2p uilX5elXzbL1OWPaNmbFkjqcmzpq2K52HTMKAHM65uBGR071OPhpU70145mIbWcDkpL9 eA0qZwALjCpAqADuT1L7jHu2M9rrzMGY/D+C67hz1Lxowj4Dv/53JxlRckij44jkQwE4 6v2nqvLB6/MnwuQoHWhTdnY86G7EsfrcGSl4oYDFJbQuSND79UzPjj+bTSVeLezstHVe FF/425gedO0mEnAiWHzGGfrH8TXldBIz1j3UwujrTiraUlXYt+WhVAiPDPjn8YGo+5/c /QOA== X-Gm-Message-State: AOJu0YzlmaXj/K3GBsoOUSWvGW9J3yCHmtCE0qBjUjUKSDZtPvqA+i3F WnKfSzApSwFHcOWPEk0jq/k= X-Received: by 2002:a17:90a:74cc:b0:267:ffcf:e9e3 with SMTP id p12-20020a17090a74cc00b00267ffcfe9e3mr15623478pjl.46.1696883629464; Mon, 09 Oct 2023 13:33:49 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id t16-20020a17090ae51000b00267ee71f463sm6776912pjy.0.2023.10.09.13.33.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Oct 2023 13:33:48 -0700 (PDT) Message-ID: <857037f5-6e15-47db-84db-5396dc70ec2f@gmail.com> Date: Mon, 9 Oct 2023 13:33:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: dsa: lantiq_gswip: replace deprecated strncpy with ethtool_sprintf Content-Language: en-US To: Justin Stitt , Hauke Mehrtens , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org References: <20231009-strncpy-drivers-net-dsa-lantiq_gswip-c-v1-1-d55a986a14cc@google.com> From: Florian Fainelli In-Reply-To: <20231009-strncpy-drivers-net-dsa-lantiq_gswip-c-v1-1-d55a986a14cc@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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 09 Oct 2023 13:34:04 -0700 (PDT) X-Spam-Level: ** On 10/9/23 11:24, 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. > > 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