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: <ZyuLn0OW8ceu9cMg@nanopsycho.orion>
Date: Wed, 6 Nov 2024 16:30:39 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Wentao Liang <liangwentao@...as.ac.cn>
Cc: shannon.nelson@....com, brett.creeley@....com, davem@...emloft.net,
	kuba@...nel.org, linux-kernel@...r.kernel.org,
	netdev@...r.kernel.org, Wentao Liang <Wentao_liang_g@....com>
Subject: Re: [PATCH v2] drivers: net: ionic: fix a memory leak bug

Regarding subject. "fix a memory leak bug" sounds just too vague. Try to
be more specific. "add missed debugfs cleanup to ionic_probe() error path"
perhaps? IDK.


Wed, Nov 06, 2024 at 09:53:07AM CET, liangwentao@...as.ac.cn wrote:
>From: Wentao Liang <Wentao_liang_g@....com>
>
>In line 334, the ionic_setup_one() creates a debugfs entry for
>ionic upon successful execution. However, the ionic_probe() does
>not release the dentry before returning, resulting in a memory
>leak. To fix this bug, we add the ionic_debugfs_del_dev() before
>line 397 to release the resources before the function returns.

Please don't use line numbers in patch description.


>
>Fixes: 0de38d9f1dba ("ionic: extract common bits from ionic_probe")
>Signed-off-by: Wentao Liang <liangwentao@...as.ac.cn>



Code looks okay.


>---
> drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
>index b93791d6b593..f5dc876eb500 100644
>--- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
>+++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
>@@ -394,6 +394,7 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> err_out_pci:
> 	ionic_dev_teardown(ionic);
> 	ionic_clear_pci(ionic);
>+	ionic_debugfs_del_dev(ionic);
> err_out:
> 	mutex_destroy(&ionic->dev_cmd_lock);
> 	ionic_devlink_free(ionic);
>-- 
>2.42.0.windows.2
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ