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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGETcx_WWxeovfDdX+oN8BreknNnQ5CBKNoxB5X9z2VQsOxd7A@mail.gmail.com>
Date: Thu, 13 Feb 2025 00:11:31 -0800
From: Saravana Kannan <saravanak@...gle.com>
To: Luca Ceresoli <luca.ceresoli@...tlin.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>, 
	Danilo Krummrich <dakr@...nel.org>, Thomas Petazzoni <thomas.petazzoni@...tlin.com>, 
	Hervé Codina <herve.codina@...tlin.com>, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers: core: fix device leak in __fw_devlink_relax_cycles()

On Wed, Feb 12, 2025 at 2:31 AM Luca Ceresoli <luca.ceresoli@...tlin.com> wrote:
>
> Commit bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize
> cycle detection logic") introduced a new struct device *con_dev and a
> get_dev_from_fwnode() call to get it, but without adding a corresponding
> put_device().

Thanks for debugging this and fixing it! Glad to see more people
fixing fw_devlink code :)

> Link: https://lore.kernel.org/all/20241204124826.2e055091@booty/
Use the Closes: tag for this link. That tag is used to point to the
bug report that this patch is fixing.

> Fixes: bac3b10b78e5 ("driver core: fw_devlink: Stop trying to optimize cycle detection logic")
> Signed-off-by: Luca Ceresoli <luca.ceresoli@...tlin.com>
> ---
>  drivers/base/core.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 5a1f051981149dc5b5eee4fb69c0ab748a85956d..2fde698430dff98b5e30f7be7d43d310289c4217 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -2079,6 +2079,7 @@ static bool __fw_devlink_relax_cycles(struct fwnode_handle *con_handle,
>  out:
>         sup_handle->flags &= ~FWNODE_FLAG_VISITED;
>         put_device(sup_dev);
> +       put_device(con_dev);
>         put_device(par_dev);
>         return ret;
>  }

Reviewed-by: Saravana Kannan <saravanak@...gle.com>

Thanks,
Saravana

>
> ---
> base-commit: 09fbf3d502050282bf47ab3babe1d4ed54dd1fd8
> change-id: 20250212-fix__fw_devlink_relax_cycles_missing_device_put-37cae5f4aac0
>
> Best regards,
> --
> Luca Ceresoli <luca.ceresoli@...tlin.com>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ