Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1797853rdg; Sat, 14 Oct 2023 19:37:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG25Av4Tu21j7jI822ep5t96+GHQ1pxQOlp+IEZBluBDMRHlthXBRnDuhqSp+6PweLOZ9bq X-Received: by 2002:a05:6808:1a97:b0:3ae:16aa:8ba9 with SMTP id bm23-20020a0568081a9700b003ae16aa8ba9mr28036359oib.30.1697337431776; Sat, 14 Oct 2023 19:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697337431; cv=none; d=google.com; s=arc-20160816; b=x2jmHCkCQEFvMX/0me3t2yGLFKJ3ASHkLD4t3/pkkvLIXluIi7pQqAoOAHyLSucDlD BKRiMtuPbdCnAXQrwZSaOFib4CKnOGhTp0kTfYBnvs4WneCDMomzPUql6YEMUO/F5EsN tmEg5n7wlpQ7fOrGAuuqf89kTGRdk3Zt1XkmRlIBxeiETn126/KG8vQGzEV3PWDxhziT Lh/XSGwmJpk0R7KQtSy/Ofiqnu5aboLUJaHMbhzU7h+tPP4fF6zoM/3B/SbgOHXhYdVf 9wugQUukPko9LdH6BKxdCIHRLdtHh3BYRUP4F0Kn7w9lF8r1syOysVkt1xnP68bHetzW xiLg== 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=VU2x4r2C1Cg+Ar4cIjbSuCvHfJH/2aoAhlJs5r56OOM=; fh=qx0QjSvL9TVePWStT0sIS0IIXiCa/ofC/RHb/QoENv8=; b=ku2maBFZuMdyYu+WZORbVor/prbluVVHrYsPIkUmEQ1qU2lyuevG0cIEnTAU4/578K Bc353JaInqm3IU4TlTpBxHWDuVWN20aFHmpkT2yvpWBm3rsdNANb88OF7KgBFxmKHI/o Y+lXYSDUikKLBIE5RyN2OMBjjXg7+nV0xEnFwzdkCV2xEniQvw0O3SRhwMfqmd5c/Br2 ehPYWqkPTLWg3uSroE9MgiHXJYidRi0PBN3EgxZ5BNU+zNJnMgyFg2cDimlxCa2/3aNK riFpmgE+Bw5wg7ucVYn/oc9R9+ylvRYlk/PDel2bVm1noL7m/caMk9s/S3MUG+GDsq16 k9RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JyaUD53G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id r11-20020a170902be0b00b001c73626a1ffsi7466246pls.412.2023.10.14.19.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 19:37:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JyaUD53G; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 280C9805F6B6; Sat, 14 Oct 2023 19:37:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233392AbjJOCg5 (ORCPT + 99 others); Sat, 14 Oct 2023 22:36:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229733AbjJOCg4 (ORCPT ); Sat, 14 Oct 2023 22:36:56 -0400 Received: from mail-oo1-xc2e.google.com (mail-oo1-xc2e.google.com [IPv6:2607:f8b0:4864:20::c2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5B41CC for ; Sat, 14 Oct 2023 19:36:54 -0700 (PDT) Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-57b68556d6dso1842053eaf.1 for ; Sat, 14 Oct 2023 19:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1697337414; x=1697942214; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=VU2x4r2C1Cg+Ar4cIjbSuCvHfJH/2aoAhlJs5r56OOM=; b=JyaUD53GYUBMrimAlpH81aFRJHFPeeoC7UCiOPQiiwcj43ZW0DnuLNd4C8NM1jEE7w BlLzGvi+6si8Wzf3Ksfce61ykygIcAAg6b230hYUhEma9hqIAmwwxdYE2sYn04n5tC62 KMSe2LtLMeDKfMA+ZXomL9Ng9JVjLOgBcdWv8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697337414; x=1697942214; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=VU2x4r2C1Cg+Ar4cIjbSuCvHfJH/2aoAhlJs5r56OOM=; b=Grr5uQ2V89TS9c8EnwBb5uWRVqiNYOKXXUtgYG5JRPgzOET40FZ4Ad6zAa4EHRDbCd YiDSSDNSibGq8dgOpDisukpcJ00vJnY6d1uo4IRhAUH4fXAn/7i7affEsF6vT8J777Lr l8oIUjhkBGwDVBeaSM+gV198JW+tDyae/bkzySWU5BpXY6ckGVshIhyLZtQjcNQtnafZ 5bmh215AARZWdXwqGENC7q6UiGLM7S1jmuibsF3MCNIdyDsDsEqFzHwy/JUExi2fgGqn cZViA4iJF95l+SLPkkAjSdplEY/wwOfsQL/7l1jit/sYZYl/KYFC0NlH4KSyeNysd9Wo 7oSw== X-Gm-Message-State: AOJu0Yx/VChslUjz7KkVCZF/rcswhccfg1c2DY0kRKbgpttnR7mOnfjC KpkmjES5F9KagZyCXeAWfGTI8Q== X-Received: by 2002:a05:6358:702:b0:143:9bc0:a975 with SMTP id e2-20020a056358070200b001439bc0a975mr29192932rwj.7.1697337413969; Sat, 14 Oct 2023 19:36:53 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id z9-20020aa785c9000000b006926e3dc2besm15684432pfn.108.2023.10.14.19.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 19:36:53 -0700 (PDT) Date: Sat, 14 Oct 2023 19:36:52 -0700 From: Kees Cook To: Andrew Lunn Cc: Justin Stitt , 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 Subject: Re: [PATCH] net: phy: tja11xx: replace deprecated strncpy with ethtool_sprintf Message-ID: <202310141935.B326C9E@keescook> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Sat, 14 Oct 2023 19:37:06 -0700 (PDT) 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 think > > 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 case > > 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. -- Kees Cook