🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #13219

Re: Re: [PATCH net] net: phy: micrel: Fix potential shared PHC use-after-free

#13219
From: Andrew Lunn
Date: Mon, 09 Nov 2026 13:24
29 lines
9222 bytes
> >.probe() and .remove() should be opposites of each other. What happens
> >if you do that?
> >
> >    Andrew
> >
> >---
> >pw-bot: cr
> >
> 
> On LAN8814, one PHY registers the shared PHC and owns its pin array.
> If that PHY unregisters the clock in .remove(), the clock goes away
> before the pins are freed. If another port is still bound, it loses
> access to the PHC. I added the handoff in v1 to keep the clock
> available in that case.
> 
> I'll rework this around the PHY that registered the clock. I'll check
> how the remaining ports report the PHC after that PHY unbinds, and
> what happens if it binds again while another port is still up.

That is not what i asked for:

.probe() and .remove() should be opposites of each other.

Take the probe function and reverse the order of the lines.

Then reverse what each function does.

	Andrew
Technical Details
Message-ID: <198e6702-0663-4183-9aaf-0fa4082dbf79@lunn.ch>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359330-linux-kernel-netdev=dewy.ru
References: <20261107-0d0c29e10a-net-micrel-lan8814-1@mail.sdu.edu.cn> <71089325-dfab-45f7-9ebd-1feb65013863@lunn.ch> <AHAASAAGLPGJfVjn9skPJKoS.3.1794229559658.Hmail.202321181@mail.sdu.edu.cn>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359330-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: Re: [PATCH net] net: phy: micrel: Fix potential shared PHC
 use-after-free
Date: Mon, 9 Nov 2026 14:24:33 +0100
Organization: Usenet Network
Message-ID: <198e6702-0663-4183-9aaf-0fa4082dbf79@lunn.ch>
References: <20261107-0d0c29e10a-net-micrel-lan8814-1@mail.sdu.edu.cn>
 <71089325-dfab-45f7-9ebd-1feb65013863@lunn.ch>
 <AHAASAAGLPGJfVjn9skPJKoS.3.1794229559658.Hmail.202321181@mail.sdu.edu.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="367139"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:kQDtEGOkCQZpgEJUTyGOWyWOXL0= sha256:uPsYZnxut+YCcXHph4/NC0GYXNeNHSAqSJPDn5806RE=
	sha1:0Eg1tC1+znwgrtAhpEb6a6Q3eZc= sha256:NUbfUR5PqFjX1Q/uMzM9gmuXvu9SCrm/M/TdDyqi6+s=
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 DA78F113807; Mon,  9 Nov 2026 16:38:34 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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] 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 h9uMsqqKvqXt;
	Mon,  9 Nov 2026 16:38:30 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-359330-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 98D76113780; Mon,  9 Nov 2026 16:38:21 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id E1A342FFE6; Mon,  9 Nov 2026 13:25:00 +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=1794230697;
	b=XsP7ef6Ezb0wh1qaqTPeLUcq8Qr8wKyliImzwua/Pg+16Zfs2lpXIyqNNPTSPES+DJU9
	 TrOpBeENE3v43JNeGNJMij0K4KfDMNQQafj1OSZrsmuOmw82jbtVltnpbAWRSL2pP5opE
	 a9FX0+0X8R1xXKMYNCJWmFgSAq23/zD4itwUb/3qCDoRgSXPXj5d1NovbzTOfcmd1zNQL
	 ZUZT7Yw1N8koeCK/n6FdKjRUeNg1HUi6XzR4dZh58TRFGhd4o2dDe8zuqEWRlo1YPnGLI
	 yE7UmI6CbBstN7DzCLz/wc8gN1ilbt2CyR2Uu6rODWyTEp4y3v3V4VSd6m+bELLXYgQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794230697;
	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=GAhGvR2eLM43D67mkW4MLIlB8OtmJdVrtLFaXc1IelI=;
	b=la5XyjNjW0p2GSmpcAWEy4LRz+FnHNF2WSbD91exlBoqTZxzx7yoq344DEhJ7RMT4GVj
	 Uuxwh7I6tm6T5o0QOE0z1rtVL+I8aqLYvtIurRHey0piz1hSyOIOouLV6nQ7BAP1O+Vrp
	 HpGoAmygd/p4o5Q1SO1AARrhc/NALHi7mNdUqVV9VAwK1stiIKEnDFBaXtaxm26SP4U5R
	 yN+K0hkCue5kvMw83OiX4DErs35ecQHNz+Zl0kWScJqpoK+sKfy9E9S3DIvqkoJx1Ynqe
	 fPKAbdYdHTp+6EQaOs038yVr+RNQOUAzdDp11Ri1ovldRAs+ZpXEdt1IrsR3P9WHKEQ==
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=Sc3XWC0o;
	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 5E567606A334;
	Mon,  9 Nov 2026 13:24:57 +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=Sc3XWC0o
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=1794230691;
	b=MRISfF0alKwTXeBaaf0bmOR/jqvdxdn32b5ZhlQuIBFRxUt/RHeT7H+TVTN+DUc7enAI
	 0e55EAVvjkMdEO77adwr8GLdeoLjDMzkYnyUQKqc2x7uJxC4qKeCtSRWuMxnCUyJscNCs
	 Dq5oYfPatCC1ij8Ul6aUYIpBwJJBGcslMrI9lP6jgP+Vt9pfSz/VooYPu/rhbMZcEe+Rm
	 0s0+8zLBXEY6o2wGalsCp4ovqKm7Ha8i1pKCdkDp8cvyUlNNpkp1M0hVMm5bejme4fHV9
	 oqTLEy5F28x35W5TTO6NC/NMzQCg3yhi8PcDpyuBX776X42hcnEoJxVRcl1r03FNtZw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794230691;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 In-Reply-To;
	bh=GAhGvR2eLM43D67mkW4MLIlB8OtmJdVrtLFaXc1IelI=;
	b=gow4BrvUE67gmSf9sgUscZHeLPCrt9EDLi+ZVH4TonDhzalbERAZtSMh8eFfCIg6Lv72
	 qA+EoxRQffAu3czBBk9AMLlDZlRcLcxW3+ebUGysH9ZK2LV0CnnOs/CEWfu94AmMu1ibx
	 KjAMHATnXIextAck7hN1BgTgptMUI6gd3gj3Hug/pb5AfdzB2yVjg3/4bkpf475JZtOsz
	 Sv68h+sJtlTv5P6A4aDWrFhQc1LPbVHsd3lHoY/Zbx6XwCrrr/ZzN7Yjg6RSfka7fvJyv
	 QPTlqwODPIHTfRlFoZSBteqqBmIMB8UGMEay85X4g/G9Yb/r+O5VOPCc1hpOCXZPnuA==
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=Sc3XWC0o;
	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 42AC8606A31C;
	Mon,  9 Nov 2026 13:24:49 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 42AC8606A31C
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=GAhGvR2eLM43D67mkW4MLIlB8OtmJdVrtLFaXc1IelI=; b=Sc3XWC0o9YL+V/AmfeKnHsFyJ0
	vVfKA4JHN882lL+MOYBFLDIGLN+oDrl2vp2bTf5n99pUEMdSkRUXAKkkAtQql77wjLw9ebcP0waST
	awreAzSJ4xneNLxoPThu5vc/wtRCtFJwtkRtiCUigrFwjhDILyDPWTwnDMcXZnnPgaXM=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xQPMP-00FG0A-3G; Mon, 09 Nov 2026 14:24:33 +0100
X-Cc: Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@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: <AHAASAAGLPGJfVjn9skPJKoS.3.1794229559658.Hmail.202321181@mail.sdu.edu.cn>