Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp71220rdh; Wed, 25 Oct 2023 16:42:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjL77SKYKXfjXvrCOFceEeHaigJrAvr7roHqed3bO4RosszpHr7vzMFU6ruo2JMapJylgM X-Received: by 2002:a25:aa2e:0:b0:da0:4201:44ff with SMTP id s43-20020a25aa2e000000b00da0420144ffmr5702865ybi.36.1698277340097; Wed, 25 Oct 2023 16:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698277340; cv=none; d=google.com; s=arc-20160816; b=Pr1iG82ARo5EvC8C660xQc2x4TCkixhd/oLTVWlfAL2FzhkW0ae/586k1Giar8xDPE LKmzZ0xruD3iIQjmgq0/HT8nlN8D0Hg3TtUgI1SBbDxs76OihHEokzfLxi/uWHUzsKl9 iUSZlC5uUGL2FXp6RL8YlkBptMzP4F3FYL7JDYEddWoGI1ZFHt6tZinE3Y+bDg/V+lW3 whYwKCEBu45RhYEKnGMRWg3fnam81mzd0FtAT3p0UiIMWZBqSHvMmvU3sPY4ycdPby6P xGQPRx+QZWY7SaH3MDFPtWTZk3OFtDn9gdCZGXjqWsSL96A98BvT8H3zpUyoDFXww9Hz utmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=n8VIiqLkglYqJ+Q19MxelXV/EJXHtj9elKsbPyNgJFE=; fh=zwJNfVY62FJtFDHKs2fRuRqRlKc5uinRgg+t0lTtO98=; b=0MZqxyZ12wxNw2MehtZ65cAcfhpLWYOIUGqn+nRQni+4prLF7OmEa4Jt65pJsw9B2Z 3q1RBicI8utadZlEWZ8rF5xfDnW7RvNH55SZ7rdj0Qlary0V1eFiopQ4IZZrR6j/jlqc S8YDdT9zX3o0FrrCMZphO6DyjjN7GJhqc9dW00tbUcx7V6Sgj0tC9HsH7E8/9SYoqXbH f32orAIhxVb2uwxzoPTDg5/cEhD9dMIx9ZyEcECkFA4jyXynyy5XPXCrNH5qE/TthHXK 4nV45zfqZCaQyIrEjQVy4gdekTHmJIebrUW7glwnTCjuPG/z37NsPO3gKo3sFI0S89x4 ix8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=X4iZxpwW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id t11-20020a252d0b000000b00d9abd90b188si12400499ybt.563.2023.10.25.16.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 16:42:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=X4iZxpwW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C4076818596F; Wed, 25 Oct 2023 16:42:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbjJYXmI (ORCPT + 99 others); Wed, 25 Oct 2023 19:42:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbjJYXmE (ORCPT ); Wed, 25 Oct 2023 19:42:04 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97B57185 for ; Wed, 25 Oct 2023 16:41:58 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-508126afb9bso353848e87.0 for ; Wed, 25 Oct 2023 16:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698277317; x=1698882117; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=n8VIiqLkglYqJ+Q19MxelXV/EJXHtj9elKsbPyNgJFE=; b=X4iZxpwW9noy6PCl7Fek6l3YBr1XUibRBJzDmAgzP82lCayz5gergKKAzLCpu/Kq6o DtfuzkoO0yo4/vuZRPQcNn4YL5P/DJJ7u/C0IpZRCTohn+pqVr68KgK+zeWZjh5b24rm 1tQOfnDf16ZjAs3diwlNVYQPZ9ySH2PkAoFAbilPzGQ69pxx9KidtW3mV9hc1h13tK0q krp2qZD2+8mn/zePSDw4fmw9665OgUIVOnqUHF+GHy/qc4VzsLBOHIywuTWF/o2lWhNL 4Y2KiGLsEtyo6EP6dbyJ3gp13vxn8wUd4YOMTTZw2ue97ytaTPbrGWuBb/dCIr3QzHt6 ZNwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698277317; x=1698882117; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n8VIiqLkglYqJ+Q19MxelXV/EJXHtj9elKsbPyNgJFE=; b=PXa7p8/XLlMstXKIvCfyAJPGrARLUhSzsR04C8UoSNdQnKrlPCmV1yQwWmYEJFqTRf ni5HbB6bc2UNXSdI6yaF/7+ZFAlH/etZtoRglDOPMYF5/cnip5dtrXwM7m8/CDBLGG+i xNgz3wdmEJltIA7gMVWbW+sW4wC2C7rgIx4aeuMEuiYdL6YG3w/kfmv4+u7hGjufaI+f 5rYIHLyZCpTflbRrGZ3kmlOssA9dsVSmV1/TCFAp/40XkJ2LKwZEpey+t3bGkvOnP9zz C8QMFt4nCY7x60dhjC+LprU9igmYvppwzrfk2/0wv1oQBrJ8QtU+ah9cxRYxUhrhWHnf QKsA== X-Gm-Message-State: AOJu0YxIsDyESUBOCk2XmsRkBgtdwwgMEDAIrPGU833JeMqwcHrLFEoN zUSGdYhA4fc7hg5LF9jVyH+UZqRcJzcgXT2LkhkFQg== X-Received: by 2002:a19:6716:0:b0:500:9a29:bcb8 with SMTP id b22-20020a196716000000b005009a29bcb8mr11657885lfc.4.1698277316604; Wed, 25 Oct 2023 16:41:56 -0700 (PDT) MIME-Version: 1.0 References: <20231012-strncpy-drivers-net-phy-nxp-tja11xx-c-v1-1-5ad6c9dff5c4@google.com> <15af4bc4-2066-44bc-8d2e-839ff3945663@lunn.ch> <0c401bcb-70a8-47a5-bca0-0b9e8e0439a8@lunn.ch> <202310131630.5E435AD@keescook> <202310141935.B326C9E@keescook> In-Reply-To: <202310141935.B326C9E@keescook> From: Justin Stitt Date: Wed, 25 Oct 2023 16:41:43 -0700 Message-ID: Subject: Re: [PATCH] net: phy: tja11xx: replace deprecated strncpy with ethtool_sprintf To: Kees Cook Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Wed, 25 Oct 2023 16:42:17 -0700 (PDT) On Sat, Oct 14, 2023 at 7:36=E2=80=AFPM Kees Cook w= rote: > > On Sat, Oct 14, 2023 at 03:55:41AM +0200, Andrew Lunn wrote: > > > I've been told that this whole ethtool API area is considered > > > deprecated. If that holds, then I don't think it's worth adding new > > > helpers to support it when ethtool_sprintf() is sufficient. > > > > I think deprecated is too strong. The current API is not great, so > > maybe with time a new API will emerge. But given there are around 160 > > users of the API, probably over 100 drivers, it will be 20 years or > > more before all that hardware becomes obsolete and the drivers are > > removed. > > > > > Once you're done with the strncpy->ethtool_sprintf conversions I thin= k > > > it would be nice to have a single patch that fixes all of these > > > "%s"-less instances to use "%s". (Doing per-driver fixes for that cas= e > > > seems just overly painful.) > > > > I guess it is the same amount of effort to replace them with > > ethtool_puts()? > > Yup, right. If adding ethtool_puts() makes sense, then I totally agree. Thanks for the discussion here. I've sent a series [1] implementing ethtool_puts() and sending out a wave of replacements. [1]: https://lore.kernel.org/all/20231025-ethtool_puts_impl-v1-0-6a53a93d3b= 72@google.com/ > > -- > Kees Cook Thanks Justin