Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2178138rdb; Mon, 9 Oct 2023 15:53:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/TQPGYv5JnBfHwPsfimIw6kIeoqT5DW0A4K4ohtdnDHj9dWcUhBKittivEzRMxik8RhAn X-Received: by 2002:a05:6a21:788e:b0:16b:b824:b25c with SMTP id bf14-20020a056a21788e00b0016bb824b25cmr10292218pzc.25.1696892035431; Mon, 09 Oct 2023 15:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696892035; cv=none; d=google.com; s=arc-20160816; b=cw7ZXOAUsHvSft1PzI+A4m+hMAxhyNfNSddeeYtxwjNO1oW6UVb77smgIAmfi0aSYV ocsVcG4OPkYd2N10+mcKJo5uU40WKx+JUhEkR5FpXErE3IAuBidHzNhC/fA4El/mAGiZ vcZeQNUVp2ICTc+Muem2KBxtGdOGVZI78pikkXZHjR1MDEMclL7GrmCvfjCszYXR0TPP 4EzXrdbcrDA1lTFmnVr96FHIRdokPnBZg6KHg/9QuqOrVbIN0mTLkC3ukH57O6oJt5j+ HRRx+g0qO3h4hC0hLTFuMD5RaPNtjHHcCan/xEfgBua7SHEdYDjUGLbTEb7qYP6ywRu8 oNAg== 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=ecHb6IFvKu9pAeTqrU5o2/Zc1by6L4Tl6dEoc4oFd78=; fh=eSSrGVmNFlMMPt2lQ+mZQ3XA1h3KxFm/FNqXkEPcNts=; b=kWZCwFInM+OtELESQKqUgj9PjxUHnJQal8q1D8LjKMQpctJJNxMcQmeJBIzKKVxF6p rIYbeTH7NlGKAlR9VtQhjSKii0OFhrV+KMz8e7K+NNtgvIYToq2Ovb92nRmeaoOomVSN tNLmelqxx3mlD88TgmUAQ59jpTVaMsrX/CGsI7hWWA+gpBvdQxycHC4EWYG5GxYZmYy0 9gRzXQaVQHSvWZskUheRjJv6gIaaOggvN3aA0qxSTQcp5aBcDUG8N1dccaUka7g1y658 H2IiGcJZxUF8vkYNNY6jByCPGhay0BN7fcGdHZjv1n6q4uHWm35Vvz9GAObw4RMm2fzg TTcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZQEjbAvn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id p17-20020a056a000a1100b006901387b0b3si621351pfh.9.2023.10.09.15.53.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 15:53:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZQEjbAvn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 5C61981CB0EE; Mon, 9 Oct 2023 15:53:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378937AbjJIWxq (ORCPT + 99 others); Mon, 9 Oct 2023 18:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378920AbjJIWxp (ORCPT ); Mon, 9 Oct 2023 18:53:45 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15ACA9D; Mon, 9 Oct 2023 15:53:44 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-41810cfc569so33189161cf.2; Mon, 09 Oct 2023 15:53:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696892023; x=1697496823; 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=ecHb6IFvKu9pAeTqrU5o2/Zc1by6L4Tl6dEoc4oFd78=; b=ZQEjbAvnV2i/xKe9GaBvw8dZTkEj8hUTb+nUQQLiz58/Zl6Q4CK9eWuvWXmyj854Q+ umW7Lf9Ly73/QLW2s+kfjWLQhpy7Q9h8bR+e0c/6XO6yrH4rZnrgeFqlcxA/sMMRiqky 4lT7J9pZyQa1pG2SXCxgb95Cxd9kkICssmn0CSL7P5lX7Oesfm7ZkUQZqBCkoyrjWwx9 uw1MlP6ekvjDsD/1TV7f6HRlD7VGUrn90QbKUocdiQYo+QnpoI2cOvbGEeCOnpPZF7CJ Pr5mhMtQpa9rbexPWseKOwkD2igLOGMqRUoJIQVNpPo9kWUd9YCZfxk7PSoa9iWU3dog O67A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696892023; x=1697496823; 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=ecHb6IFvKu9pAeTqrU5o2/Zc1by6L4Tl6dEoc4oFd78=; b=Um9dWo0bTt2M+vGMI51FXRCNYUUZOQQyHjqJl7eXURy/ttZkD0ucvmo3l+7iZqg86t mJ8iHKZEGvCKbYE6gInceNE0o+ohFf77Ou8aFrT0Jz98tPzjqszbpUcmII6rb1jjtVUk YxqUDRXpqHcMSH410i8E9KNE7KCWYw0x3RGa2+iZ7il12m6U0VavDAOj0hkyl8ZYB8uu JVmAElp6+pLd5yXOFXxMYiCRTYRAsQ70hIUi7J6MaA1W3+DnYUQGvCpugw6ix/x8FktH rvN0R0gTGkHX7U0spVPtRw1wOabmAG+b+vgX127BqInHlI7VoL6JcHn06qHrF10rEzOW LctQ== X-Gm-Message-State: AOJu0Yzx95RamdS21pYo6CzZUo16XPb4o4tG+VZCoK8UPBVSuyCLVYS5 b4DPbRPlWRIRFC+LGs4Kfck= X-Received: by 2002:a05:6214:398a:b0:656:4a21:2c5a with SMTP id ny10-20020a056214398a00b006564a212c5amr17009754qvb.9.1696892022853; Mon, 09 Oct 2023 15:53:42 -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.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Oct 2023 15:53:42 -0700 (PDT) Message-ID: <24136e9f-8e36-4dcf-88bb-f9189df40269@gmail.com> Date: Mon, 9 Oct 2023 15:53:40 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net: dsa: realtek: 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-rtl8366-core-c-v1-1-74e1b5190778@google.com> From: Florian Fainelli In-Reply-To: <20231009-strncpy-drivers-net-dsa-realtek-rtl8366-core-c-v1-1-74e1b5190778@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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 15:53:53 -0700 (PDT) X-Spam-Level: ** On 10/9/23 15:47, 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