[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250217135107.GL1615191@kernel.org>
Date: Mon, 17 Feb 2025 13:51:07 +0000
From: Simon Horman <horms@...nel.org>
To: Alexandra Winter <wintera@...ux.ibm.com>
Cc: David Miller <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
Julian Ruess <julianr@...ux.ibm.com>, netdev@...r.kernel.org,
linux-s390@...r.kernel.org, Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Thorsten Winkler <twinkler@...ux.ibm.com>,
Wenjia Zhang <wenjia@...ux.ibm.com>,
Jan Karcher <jaka@...ux.ibm.com>, Gerd Bayer <gbayer@...ux.ibm.com>,
Halil Pasic <pasic@...ux.ibm.com>,
Stefan Raspl <raspl@...ux.ibm.com>
Subject: Re: [PATCH net] s390/ism: add release function for struct device
On Fri, Feb 14, 2025 at 01:01:37PM +0100, Alexandra Winter wrote:
> From: Julian Ruess <julianr@...ux.ibm.com>
>
> According to device_release() in /drivers/base/core.c,
> a device without a release function is a broken device
> and must be fixed.
>
> The current code directly frees the device after calling device_add()
> without waiting for other kernel parts to release their references.
> Thus, a reference could still be held to a struct device,
> e.g., by sysfs, leading to potential use-after-free
> issues if a proper release function is not set.
>
> Fixes: 8c81ba20349d ("net/smc: De-tangle ism and smc device initialization")
> Reviewed-by: Alexandra Winter <wintera@...ux.ibm.com>
> Reviewed-by: Wenjia Zhang <wenjia@...ux.ibm.com>
> Signed-off-by: Julian Ruess <julianr@...ux.ibm.com>
> Signed-off-by: Alexandra Winter <wintera@...ux.ibm.com>
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists