lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251219121754.GD9788@e132581.arm.com>
Date: Fri, 19 Dec 2025 12:17:54 +0000
From: Leo Yan <leo.yan@....com>
To: Suzuki K Poulose <suzuki.poulose@....com>
Cc: Ma Ke <make24@...as.ac.cn>, jie.gan@....qualcomm.com,
	james.clark@...aro.org, akpm@...ux-foundation.org,
	alexander.shishkin@...ux.intel.com, coresight@...ts.linaro.org,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	mathieu.poirier@...aro.org, mike.leach@...aro.org,
	stable@...r.kernel.org
Subject: Re: [PATCH v2 RESEND] coresight: etm-perf: Fix reference count leak
 in etm_setup_aux

On Fri, Dec 19, 2025 at 11:48:35AM +0000, Suzuki K Poulose wrote:

[...]

> > My understanding is we don't grab a device from
> > coresight_find_device_by_fwnode().  The callers only check whether the
> > device is present on the bus; if it isn't, the driver defers probe.
> > 
> > This is similiar to coresight_find_csdev_by_fwnode(), which calls
> > put_device(dev) to release refcnt immediately.  This is why I
> > suggested the change, so the two functions behave consistently.
> > 
> 
> I see, sorry. I saw some other uses of the device, but clearly I was wrong.
> May be we should simply re-structure the function to :

No worries and thanks for confirmation.

> bool coresight_fwnode_device_present(fwnode)
> {
> 
> 	// find and drop the ref if required.
> 	return true/false;
> }
> 
> The name "find_device_by_fwnode" and returning a freed reference doesn't
> look good to me.

Renaming is good.  Maybe use a separate patch to rename:

  coresight_find_csdev_by_fwnode() -> coresight_fwnode_csdev_present()

Thanks,
Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ