Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2178040rdb; Mon, 9 Oct 2023 15:53:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOl9dVSSsWU5/3oeSyQBUsb5gi3mfMIqVTP0/WXNZNb8aEPI4r0rHdeU0IJhNlycYJev4u X-Received: by 2002:a05:6a00:b8b:b0:68f:d1a7:1a3a with SMTP id g11-20020a056a000b8b00b0068fd1a71a3amr19845045pfj.8.1696892014312; Mon, 09 Oct 2023 15:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696892014; cv=none; d=google.com; s=arc-20160816; b=xtG/G0AX1DX2vtgr/0cohMSaEydH2Anp5EY+Ny4epDDpiqhsjo53tDZFgfQ6VRJpqg dBYMosCNF7X/EJD/A4ILQMiJVjbkYx0/bW3mcfwl1tGcer0QLf5TKKGa99BYEWSlQ3ot tOBdaaoBsmgdvDcU9iASbnuXb8PhIFBdBME3U+YYMRWHtdpvuTajEhiYDkWcrdPv0y7M PHVGAJQYIEx3HcwL529jxsUQKf8COdvI0GaHlcqqJVMhpveQP0tXPTfLiIx9tKVmzzLz Lv91Lgkk/tu4xITHBfAzMRmQ+Vs9VIi0jsLZNnu0Wya0HCxI/C/QnVxHQXoplxuFa5Yu TbBQ== 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=lekoIS635mFSnJFnmD86U+ekn9Tz8INaPVzVfkQ9DI8=; fh=eSSrGVmNFlMMPt2lQ+mZQ3XA1h3KxFm/FNqXkEPcNts=; b=EQw4ZOEGc/9mx3RywaUC8yBeT0+5Vnp4mx2NdpTSiZINdCy/8gQ23lDjOvRMpjyutb axXoccapqgAjngqMe+TH26Wfr7SY7YBDmNYMb4CwAyoXTGH27r0ex9to+HD+h1Ma7A7T CC7iFfikFCCUXt/YXlcgURrpTOdY6GH6XLckRh/DTycTBH7DLCDK6xgBXtUi9OrSssVg fYgVm2Fh9Z5C8T+mpb+ui7/dNz+ddmYggQWVUtUA+GLYQ/Ljt5S82eYZqttXZWK7193q tCbzZH7NTNUWajL9CPImEZQsNTTI+G8FfWeK4HK6NVIgznGoVEOxSLuiwQrFLgrgHSv5 NZ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lcB4F6dV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id cd6-20020a056a00420600b0068ff333d768si305636pfb.384.2023.10.09.15.53.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 15:53:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lcB4F6dV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 5ECDA809B9C0; Mon, 9 Oct 2023 15:53:33 -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 S1378923AbjJIWx1 (ORCPT + 99 others); Mon, 9 Oct 2023 18:53:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378784AbjJIWx0 (ORCPT ); Mon, 9 Oct 2023 18:53:26 -0400 Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25DE09D; Mon, 9 Oct 2023 15:53:25 -0700 (PDT) Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-7740c8509c8so288856285a.3; Mon, 09 Oct 2023 15:53:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696892004; x=1697496804; 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=lekoIS635mFSnJFnmD86U+ekn9Tz8INaPVzVfkQ9DI8=; b=lcB4F6dVnE8vmlomKYhAD6xLlirfWAQlZGW5XaRFiitOHkB4S7AuNbxdP/mgSR6tvB lWtE5iEKX1vWBouR2/GtTNFtYs6nmgtvu8ot8NI7md5LpT/Iv5iN5x4MaHv4h+bAtd7E GAY1PPuOJQQCICPBJRCH0d51mzbJDip9Y/bIT3qIHMdCUeYZQwNkFa6OWvjRBsKrYsQu oJ3C03Cju910vdRsu6jX3JJQGPX/GAbnuJG4oi9/pkSW7TeW6W1I/vmbo3zrMKFuMzfg tJClLMc+8q1xqFHzjl4CpynbawOAdJaY9tEd2UvP94AsZvhpaYWMzTzDp1rxNf0NDwIX 2CjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696892004; x=1697496804; 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=lekoIS635mFSnJFnmD86U+ekn9Tz8INaPVzVfkQ9DI8=; b=tIboxvVzo9aAT/Ygbo9LrvURb5DLcgmR4lbNs6FJbbukI/XJMu213cGGq/k01WlclK /IMn4HvJVHkhyJsTd30LOZOyZlffGffnndKfROVwS6bW6eUw+i4BHDbpFE/2ivbWCBZy bkVXCtYfaptCv04xmttNCWGIpuw/wDR96JH54iaw4tzTwrxldinM4ipZ+mBjSU4eR31q 75w2cxUHXS8QOg7DN8Q4ySPrnHO1gM4KIJIiiBV1DbmBG00oNprLB6/ad0SKO99rMXn7 Fpknom+iRbO1/bcLc/9HWvE0HrG4lQ6mc7rgCJDgu7wPVVOHuXC5oQBB18NE00jv4djZ 3k3w== X-Gm-Message-State: AOJu0YzX5lbn9Z1lm/hYk+sLXIevnemA7qIAY/1AYvGY2S6IdBMPBZD5 h1/08TSJB3VTpbCEn7sS1RI= X-Received: by 2002:a05:620a:240f:b0:775:90b5:f91b with SMTP id d15-20020a05620a240f00b0077590b5f91bmr17404095qkn.3.1696892003976; Mon, 09 Oct 2023 15:53:23 -0700 (PDT) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id os7-20020a05620a810700b00767e2668536sm3860565qkn.17.2023.10.09.15.53.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Oct 2023 15:53:23 -0700 (PDT) Message-ID: Date: Mon, 9 Oct 2023 15:53:20 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: dsa: realtek: rtl8365mb: replace deprecated strncpy with ethtool_sprintf Content-Language: en-US To: Justin Stitt , Linus Walleij , =?UTF-8?Q?Alvin_=C5=A0ipraga?= , 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-realtek-rtl8365mb-c-v1-1-0537fe9fb08c@google.com> From: Florian Fainelli In-Reply-To: <20231009-strncpy-drivers-net-dsa-realtek-rtl8365mb-c-v1-1-0537fe9fb08c@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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]); Mon, 09 Oct 2023 15:53:33 -0700 (PDT) On 10/9/23 15:43, 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