Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2126451rdb; Mon, 9 Oct 2023 13:33:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/rXjfiw/vuwkus2ZHEZrJpDqhDSCuPFcS/HIkdj80iN67fdJKhwEVTM95+7J3sBe8GhlM X-Received: by 2002:a17:902:dacd:b0:1c7:54ee:c53c with SMTP id q13-20020a170902dacd00b001c754eec53cmr19098490plx.57.1696883633202; Mon, 09 Oct 2023 13:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696883633; cv=none; d=google.com; s=arc-20160816; b=zxVdg/PeZyhS5lHdDSwKrqkQ/zF9AE5Msey5XxeJatLQC5znNEIkIF2mkoWgNFhRfN Ut7/XQKoXkpQv6Z61KTwuxl8xL1lucvNw9fHfp/d/VqciUF9jaVAdZrOROoVag/js9Ri HEep2jpuGaqnMzSYhNTgdHs9HY2FkgNm9tBtX+eyuJDw3ke61j7+V8LbdSZAU+zgAQB1 xAJSfCkJ3oHcSxVyMfJwM1vV5TzcsPFd0E26LFBDX7tt8NeitguRq0LAuMv6teVKDrZw QCNZZytdokIGSOWpxah3YKAtxWWbbMqA5voZJESc9TwVIV36zDW+RlnGf3ULc1YOP4eU QeQQ== 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=60nr4fzdTros1/1caE949JK7IrJG6r4bnbVLYmh8Yuw=; fh=WaR4Gl1cZncYFgFomCWTfFwzJNqFZCe4atwy9jcjKRM=; b=TayihBWy3KssDD2RBAVCC5+wm6BXNqUdbxY2OYtoc5xZPjpL9HfFUnDIavBZ84cPsl MRdP07aB6MW2azwDDNLiRJ1vWoDEff7JwL1osluIZq1I60kK12+EoT9GHhmQzEKshmdu P3Lcb274YUFqoZlFy8RGRAYFMdYtweTHaDnE+xlz+TQf1rNVsJau2UqwrynYpV4FFB8x XYBPXEtzup5IobWKhB/4kOENRHELnvvuEtty3zeeAzbtkN/YdbS8fVNKwsigfdbHza2N 0brhZuq6wqZRjElrVyieOeX2UD6KVSli/Obfne3LACQADNqcdoiw07KlhlsSPOj52dT3 61OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Ha1dy2Cm; 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 f10-20020a170902ce8a00b001c77916e87dsi310346plg.591.2023.10.09.13.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 13:33:53 -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=Ha1dy2Cm; 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 67C2A80BB514; Mon, 9 Oct 2023 13:33:48 -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 S1377937AbjJIUdk (ORCPT + 99 others); Mon, 9 Oct 2023 16:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377753AbjJIUdi (ORCPT ); Mon, 9 Oct 2023 16:33:38 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 901BBA7; Mon, 9 Oct 2023 13:33:36 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-279150bad13so3686291a91.3; Mon, 09 Oct 2023 13:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696883616; x=1697488416; 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=60nr4fzdTros1/1caE949JK7IrJG6r4bnbVLYmh8Yuw=; b=Ha1dy2Cmmp+FkYSu1SKKNG+GEZriLzFB/lJyw04F5ejqB56N1z0nSfnVICaXfC6fvY T1/SYVOVQK789wGletx83rLFMtMpSavyUFGGmJohGQqLe/rayLBKd3dxHjZNUGF4GCy6 6z346WScCdAI50UsKdWEGVqUYVwCkLCPqptVu0YfzufiJkeaTS+v1GB88/PcPRpYHPZi nYmGiJTKLS4uwCdm4edWL7xL78tq3vZI/7nJUqAMz4E9p+8dzT2dg3QOlpYrbTMBwKlm SJ4LkV05waWomvkl7m4gNs4J/bz/uIWl4orr1tnTsp4FPDFBB38kjLofcAr3RZjsfFLX /evw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696883616; x=1697488416; 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=60nr4fzdTros1/1caE949JK7IrJG6r4bnbVLYmh8Yuw=; b=VeSAKkej41qeMpYAQhKuE3iyN0ObHP200nbvXVtUguiwH+hEj6AXQ7Q6wMLYlueir+ yhuVkRy6TTrSTGKeeai8QOJNTGQaeOOKJtXkEf6+DUnfQuAIArC3RazvnC7kBMhgs5ca 9tIioLfrpc2HxyekqM7KK0KdDHTV79aAjUMIKvYeZwCzE+rG5E60aF6o5Z1bTkESK+Vk +3XlCxjAYU1WGyD6IO3zDC7cDt2xK8hG53+iAor3oewXraWSqiHNRhFsqkOuMczTSRUV uVPE/YXdryC6rF/k5Q5V5p0iBCeTaAFy/WqagGdKP6ZyaLjGhN+D7tZItCy4EE1yOA1h 1Odw== X-Gm-Message-State: AOJu0YzXCJ57Z/83KWR6whUc0IsnaDjEDF5j/j9YqXxGq+E7zjJNL5N+ HQRtzzd17W+ge7+tWwIviwuigr+EqpE= X-Received: by 2002:a17:90a:34c9:b0:274:7725:ed9c with SMTP id m9-20020a17090a34c900b002747725ed9cmr13483727pjf.35.1696883615968; Mon, 09 Oct 2023 13:33:35 -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.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Oct 2023 13:33:35 -0700 (PDT) Message-ID: <5c25f59d-fcd5-404d-b2b4-e77b7ca0f512@gmail.com> Date: Mon, 9 Oct 2023 13:33:32 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird 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 , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno 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: Florian Fainelli 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=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:33:48 -0700 (PDT) X-Spam-Level: ** On 10/9/23 11:29, 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