Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1626183rdg; Sat, 14 Oct 2023 09:34:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMy58EtH/92NGqhvsqyHCkaxVGkO8c67jfKkqO9JJhk2kQRKZ00MuoTu3ojB+fnjysJCel X-Received: by 2002:a17:90a:fb87:b0:27c:ecec:8854 with SMTP id cp7-20020a17090afb8700b0027cecec8854mr5026091pjb.7.1697301244911; Sat, 14 Oct 2023 09:34:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697301244; cv=none; d=google.com; s=arc-20160816; b=WBi3/766LjMOUpG4sRfqXQMpdoQGEMLx+dA2ylKQAYHHhcGeigdhBfkmuPHINkZmbf YA+6kkBLlHDCIfEZ6Mz/Pr+dCud6gFE32CIe/4WPdI5/G+T4HqTbWlF6xmvLGpSZxjWU 5JibUF2OS84gs5DybwkmaxS3DyMNIAa/6rySMt6c8cpaBIfBI3ojkiNxEN4J6DHQIzZC qBXVwG8Py+RGIdwKO2K76iWpJh8Nz9RA4G0Qw9UoKpj3JWtezAMRJPvUxCRMPgvTzptx iN2+ggdcdK73I7FDb4F/cGEYolY/H+QgshHVLl11oEN3T0Yw8wVa3Jsf7pREFU9yiYhg ZJlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ckHPv1sodqbF6lifWLlHzkUp3Ph1Z+9dz/OCscR9s84=; fh=PBsZ6gv9Jg0MRClkHN0Gcdl1aOVciKZuX3UJR0d7SPI=; b=wLx2RlMp49w6CYR5KFo3/Dqqlb+Ws2yZUIzE9PWWVqMkxf9+O+7BqNS4CUGX1Riu/S IoqgibrvB36j2DKA3Dp7RPeppOVt0Wt7I901rX2YK6vX2X56BWDgu+lIQ9NiGuwgVq6e 97yVIhE1esArPU9RziYyBzgk7trjwXaLSQjkXB+ZC+/kuXIMkuKQnquGiGzBaSSEsPKS uRmLCa6Pv2ywiWhduRZajwC/uoMJlcJor/vLbFoewAnnRSUJFklUE9SW9PbFx76mpreP tEX7x3U3kaHGPBkUy7nuwvrzvNYiCaP/tOB8ToSr4aJ0oZK3n9/Mr9QajHeDAhpWDEu0 Ur+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=S73aBPif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id a14-20020a17090a8c0e00b002613720fcd5si2614318pjo.35.2023.10.14.09.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 09:34:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=S73aBPif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2EB7F80B8F12; Sat, 14 Oct 2023 09:34:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233238AbjJNQd4 (ORCPT + 99 others); Sat, 14 Oct 2023 12:33:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232238AbjJNQdz (ORCPT ); Sat, 14 Oct 2023 12:33:55 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7054B7; Sat, 14 Oct 2023 09:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=ckHPv1sodqbF6lifWLlHzkUp3Ph1Z+9dz/OCscR9s84=; b=S73aBPifwKqmrm/X8vJwwk++Ov Woj8DwtPzhu0RSM+iDCxB0QZPa8RfOknlQS8l9D3K6mrBqbe30hYm2SMlez3GssVpY5WTg90vOeTB RTeceVgGl6ZuT9vOXzm/PMg+wyjrkZYSw0UPlLguWbFBDCjff5UzIyWwXfuPzBpMySa0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qrhaG-002Bfl-Hs; Sat, 14 Oct 2023 18:33:48 +0200 Date: Sat, 14 Oct 2023 18:33:48 +0200 From: Andrew Lunn To: Justin Stitt Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] net: usb: replace deprecated strncpy with strscpy Message-ID: References: <20231012-strncpy-drivers-net-usb-sr9800-c-v1-1-5540832c8ec2@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231012-strncpy-drivers-net-usb-sr9800-c-v1-1-5540832c8ec2@google.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Sat, 14 Oct 2023 09:34:02 -0700 (PDT) On Thu, Oct 12, 2023 at 10:33:34PM +0000, 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. > > Other implementations of .*get_drvinfo use strscpy so this patch brings > sr_get_drvinfo() in line as well: > > igb/igb_ethtool.c +851 > static void igb_get_drvinfo(struct net_device *netdev, > > igbvf/ethtool.c > 167:static void igbvf_get_drvinfo(struct net_device *netdev, > > i40e/i40e_ethtool.c > 1999:static void i40e_get_drvinfo(struct net_device *netdev, > > e1000/e1000_ethtool.c > 529:static void e1000_get_drvinfo(struct net_device *netdev, > > ixgbevf/ethtool.c > 211:static void ixgbevf_get_drvinfo(struct net_device *netdev, > > ... > > 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: Andrew Lunn Andrew