Article View: linux.kernel.netdev
Article #17544Re: [PATCH] net: phy: realtek: fix listing of sysfs directory tree
From: Andrew Lunn
Date: Tue, 17 Nov 2026 00:46
Date: Tue, 17 Nov 2026 00:46
42 lines
9672 bytes
9672 bytes
> [Severity: High]
>
> This fixes one driver, but does it leave the root cause in place?
>
> The symlink name under /sys/module/<mod>/drivers is built from the raw
> driver name in make_driver_name():
>
> drivers/base/module.c:make_driver_name() {
> driver_name = kasprintf(GFP_KERNEL, "%s:%s", drv->bus->name, drv->name);
> ...
> }
>
> module_add_driver() then creates the link under that name:
>
> ret = sysfs_create_link(mk->drivers_dir, &drv->p->kobj, driver_name);
>
> kernfs accepts the '/'. When the directory is read, verify_dirent_name()
> in fs/readdir.c rejects the name and getdents fails for the whole
> directory:
>
> if (memchr(name, '/', len))
> return -EIO;
>
This is a kernel wide problem, so i don't think this patch needs to
address it.
> drivers/net/phy/smsc.c: "SMSC LAN8710/LAN8720"
> drivers/net/phy/qcom/at803x.c: "Qualcomm Atheros AR8031/AR8033"
> drivers/net/phy/marvell.c: "Marvell 88E308X/88E609X Family"
> drivers/net/phy/davicom.c: "Davicom DM9161B/C"
> drivers/net/phy/intel-xway.c: "Intel XWAY PHY11G (PEF 7071/PEF 7072) v1.3"
> (plus three more entries in the same file)
> drivers/net/phy/microchip_t1s.c: "LAN865X Rev.B0/B1 Internal Phy"
> drivers/net/phy/xpowers/acx00.c: "X-Powers AC200/AC300 EPHY"
Maybe turn this into a patch series and address all these, one patch
each. That way, if we have any ABI issues, it is easy to revert just
one driver.
Andrew
Technical Details
Message-ID:
<5f27878a-1206-4f67-aee9-833f31506997@lunn.ch>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364861-linux-kernel-netdev=dewy.ruReferences:
<20261115214045.3704-1-mat.jonczyk@o2.pl> <179486542983.3136.9636959145442798025@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364861-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH] net: phy: realtek: fix listing of sysfs directory tree Date: Tue, 17 Nov 2026 01:46:57 +0100 Organization: Usenet Network Message-ID: <5f27878a-1206-4f67-aee9-833f31506997@lunn.ch> References: <20261115214045.3704-1-mat.jonczyk@o2.pl> <179486542983.3136.9636959145442798025@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2206128"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:dRb4amDlGl4OUtBt7PF/tuYyinY= sha256:r6nfunj14CXBHSqCvln3LHPoGtDJ00peFSukW8zgQGs= sha1:VGynd6C9d490cyaQBaXo8bbfrr4= sha256:x2pVs7ZpEL6VzriURJeXIovH+qN0pDktyQWCUlXMwhs= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 05A9F114DEA; Tue, 17 Nov 2026 03:48:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7E-izQ2H39PZ; Tue, 17 Nov 2026 03:48:00 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364861-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 58C19114DE7; Tue, 17 Nov 2026 03:47:51 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id D10102AF1E; Tue, 17 Nov 2026 00:47:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794876460; b=h1DxxbvlVrkBf2VMRPuwPI0LakKUvhIUsfc3irELVqugl0HiEDbU0NNz1+ad/1VBTD2c Cb3xBpHjhB5VIS8EBOtZ1MEur6xeJCz52RuZjx8JB18RM4Al+cKn7A6inKpaPO+mAduZn bJ57yQ7eE384A2DuOIHZglKNNj3yvjD34++Fka9S9ELM2yYvcG6bJfNEQZ3XeHOSfCPk3 3DLdoHsL3LtBKOUbl5ElybSS3Rzqn0zMTf5GJSDMoV2GUSk5eYn6M+Dcr5pUHKgIWuJyH vRx+iiN3ZyOVXpsZi5E0KN66Ry5X5Kj+D0JttgHGAHmUdg9Z71LS9rsMZQM2ZBzy6iw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794876460; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=EzHb/fuWX0qpgDrGWWE11dYasvPizPREh36LZjZG9d0=; b=JbpyReY7dhiTroMfkNKHLFPgx8zhjsM8MKFRR0DTkIKvcXp6mqyGVnezw1qwU3zryyZx 8JMBblpdA2ro+byVY4NtTecWa5zjhtL4urfMU1fIAQm41ObZT7JbBR41pEO4aY52/Seyo 0OA5rpGs6gbFv4Xts7BWZfKULPZN2FLoV7aJ7hVSCPw2Kiy70PmYG5xQKTNGHmTNiK7Gb VEPyHwR7q6oM2O+N2egWHhN2IExEsfCbbm+f5MWnBISLkqhltKmT8GGSBJ39i8EtUZU+d hJ2QS+DUey004niJQq6yeRvJvv+9kC+woyA3ZdqLDOjzzU3DhFi454/POYTTGYULnQw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=FJ0kL5B4; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A5639606A323; Tue, 17 Nov 2026 00:47:40 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=FJ0kL5B4 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794876454; b=Lf8XqxMf2sCjgZcU0bSwk8GyMGoPuPXYigOrrNIjxZ3RLJUCEndyYYvOvPtlZBya9tUN 7O1odS6+BItgnFYz5iUaJqewneAYz6PVe5SAR3W6DzIeD/r5BOeBZ1IMy8pQzYO6sxtHo 0eF7FG4k1D+2xIwlZM+mK1Vm5neqWd9cS+efaEcpvSfQrFpSddqjRWEMyAR+18wsohOJ2 jexPPSJQkQwjZiC5wpi3tbaWYGw8d3OnOmq6P+3E+F8fIYIq03CeeaFuZtynNjTugJJEx MFYGEcY8OBu+iQfpNGq12R0rURciAYyc3qWACvonBU1vvjq647JiNKp665VetGuHC+Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794876454; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=EzHb/fuWX0qpgDrGWWE11dYasvPizPREh36LZjZG9d0=; b=El2WC03eIY/N0/QsLqtvMnOsxy8aoHow/xUhSltIxIfdr6e8M+tordqug8XK/HbHADMC hyneTOCkPx9D5DjvvT4s3aeZzLUprJ1a3nxNL5iKTDSNoBy06pnogMujOimCGC8/U7bC3 1Rl+XUi0y81N3hlHGN1CEkNAg0F8iqmzV/Qqbs4EjKi0+x/c28wsk7LK70zgBYaCmIZyY bbM9yJgPfVHpHowAk6nnmJJuQPdPNGFJ4gFSQFOlp0M2eAhiq60kpVRfl31kejt+o3E6f mMvEHTA9sQA2pWUBiyFwzOYbd/c2BLIYnxjWTQrgXZLZpVSbff1uoyshR7Ut9w+19NA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=FJ0kL5B4; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6202E606A32F; Tue, 17 Nov 2026 00:47:34 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6202E606A32F X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-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=EzHb/fuWX0qpgDrGWWE11dYasvPizPREh36LZjZG9d0=; b=FJ0kL5B4LlQjfAWBTEgwwfm1+x vwYO3BjSMf/rwUxFLd1RzMknv2bHViN+aLS+nMUFbHMXnTtH0kiyTghQsKybH66Ak2mXAktAu+eJO 4BW8po2zMo3TLjkVpwyhIx6btV2MP87J/w9jHAm72YS82RfFZNcpKNWWOsALP8ga3vNE=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xT7Ld-00H2hL-85; Tue, 17 Nov 2026 01:46:57 +0100 X-Cc: mat.jonczyk@o2.pl, javen_xu@realsil.com.cn, hkallweit1@gmail.com, linux@armlinux.org.uk, kuba@kernel.org, maxime.chevallier@bootlin.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <179486542983.3136.9636959145442798025@kernel.org>