Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2381826rdb; Tue, 10 Oct 2023 02:07:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEAGt6MwMfICDYOHwJz+47ODA0mgxBcbIOvrIqbSWRLZfsqlU2IfuVg7BVKcMDlZxV/NwTf X-Received: by 2002:a17:90b:3843:b0:273:e42b:34c1 with SMTP id nl3-20020a17090b384300b00273e42b34c1mr13657740pjb.42.1696928852400; Tue, 10 Oct 2023 02:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696928852; cv=none; d=google.com; s=arc-20160816; b=BfR1OAdB6ARTM6S+F9P7+XW8+g9exVnIleL6xC0WVgSrOC1Bc5Gr+e2RDOslJvnvDc qY8/WmrDtZs6ewk8pE9I+mOy46VqKigv5raxO5PCS6jppakV6MlGlBlzmFyvFPKaUiXi pQ7FYP2uao/xJdBwIqlFDHjkHSr6vp2HIspw27khTJb8vkvvg/knCx550GlyKhVThAFo nwfwHDXj0qJo4M2qseiNtJ4F1HuV5ZJ0bw5aGpAxdTuysePN50UDNrkYAr91wi54NlS6 vsbqpqtoDXQCxrogJxrV521ggkULxgiRk7cXaceCZdlRJqUx86GE22yW4lX0jKtIIs8/ Rc9g== 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=LhuBvXXV5WvInOmZ4Y/6WfZ+5pqYZx+yCkgxt3/20XM=; fh=v4yaMeOGFumLT+u0zQTmcVCZXJ9US+cxWCD+Ie+shZ4=; b=FONDS3SeDv4zxw7e3zadDLM0I28CiISuPNUsO1KDJ+QzhCS53LXp1+JeiHAMuRG5iY Kb+JcdbEBOJLOrAJ5IIM9jMVD6Mcbdgwds24TuNEOzMuNaYHkYXqlvnFpb54+szg1EYg yw1mCWtHIKcmGc0nsigFov4WiiVFd7miY7jos+WvzYivBSBLdKX1dLhcQojqoCGGWuYH jo7fTJaef1nLZqK8XtH2hIct6GF4grKnqSbsZDhYxZr5tqmUetYlJcQ2WB8nUnokGSTO +zmkpXLZLy22NvgcrvBDszDoqBnk7bNymTivvZXDPPLYNMPJX89tCZIHEbzlo9snR4Hy bQJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TUOrF1Pi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id il7-20020a17090b164700b00274dc876792si12355686pjb.98.2023.10.10.02.07.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 02:07:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=TUOrF1Pi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 76FEB807216A; Tue, 10 Oct 2023 02:06:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229826AbjJJJF5 (ORCPT + 99 others); Tue, 10 Oct 2023 05:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbjJJJFr (ORCPT ); Tue, 10 Oct 2023 05:05:47 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27E34B4; Tue, 10 Oct 2023 02:05:42 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 2298866030BF; Tue, 10 Oct 2023 10:05:40 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1696928741; bh=g5wWTSMfgxfFuNzyWh6JJgEJpm8OKALaOO+HuJaW/TQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=TUOrF1Pi096aYe2AGtryDLFF71aDQ2xiXp5BpMwo+zSlgdfwQzWZuXjk05VvI7x0b dac2xWlBxFIPRvmpPYTTBcIPUBi/O7R0sFR+p2G4TWrBDQfUD5dwbBCkGKTXK1I3yC leRiONy6iRef4Z531+Z/jrhYAhvrTEtL8BLUUiX7rK0KDvjBBulsVgoC3BUCJdbC2/ PzutCAsIPjkFUpLVgCjt5awlwanu7L8RN7oqr7/4xHydUkp/yD/12HogXbGjeirFaE uHOkmQ6sPp9pVQrtJST1NA0TDE9cAA4Hkh3Flam1e+9W9/vtgqhFocjotEnN5CIim4 OYbhr9pp5rEXQ== Message-ID: <3eef5dc0-af64-baa9-d760-3b438d491c8a@collabora.com> Date: Tue, 10 Oct 2023 11:05:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH] net: dsa: mt7530: replace deprecated strncpy with ethtool_sprintf Content-Language: en-US To: Justin Stitt , =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-hardening@vger.kernel.org References: <20231009-strncpy-drivers-net-dsa-mt7530-c-v1-1-ec6677a6436a@google.com> From: AngeloGioacchino Del Regno In-Reply-To: <20231009-strncpy-drivers-net-dsa-mt7530-c-v1-1-ec6677a6436a@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 02:06:16 -0700 (PDT) Il 09/10/23 20:29, Justin Stitt ha scritto: > `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: AngeloGioacchino Del Regno