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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4CA22223.3030701@caviumnetworks.com>
Date:	Tue, 28 Sep 2010 10:13:07 -0700
From:	David Daney <ddaney@...iumnetworks.com>
To:	Vasiliy Kulikov <segooon@...il.com>,
	Greg Kroah-Hartman <gregkh@...e.de>
CC:	kernel-janitors@...r.kernel.org,
	Ralf Baechle <ralf@...ux-mips.org>,
	Andy Shevchenko <andy.shevchenko@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/9] staging: octeon: use free_netdev(netdev) instead
 of kfree()

On 09/28/2010 10:08 AM, Vasiliy Kulikov wrote:
> It is not guaranteed that free_netdev() is macro.
> Freeing netdev without free_netdev() leads to net, tx leaks.
> I might lead to dereferencing freed pointer.
>
>
> Signed-off-by: Vasiliy Kulikov<segooon@...il.com>

Thanks, you can add:

Acked-by: David Daney <ddaney@...iumnetworks.com>


> ---
>   drivers/staging/octeon/ethernet.c |    8 ++++----
>   1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
> index fb568a9..a8f780e 100644
> --- a/drivers/staging/octeon/ethernet.c
> +++ b/drivers/staging/octeon/ethernet.c
> @@ -670,7 +670,7 @@ static int __init cvm_oct_init_module(void)
>
>   			if (register_netdev(dev)<  0) {
>   				pr_err("Failed to register ethernet device for POW\n");
> -				kfree(dev);
> +				free_netdev(dev);
>   			} else {
>   				cvm_oct_device[CVMX_PIP_NUM_INPUT_PORTS] = dev;
>   				pr_info("%s: POW send group %d, receive group %d\n",
> @@ -756,12 +756,12 @@ static int __init cvm_oct_init_module(void)
>   			}
>
>   			if (!dev->netdev_ops) {
> -				kfree(dev);
> +				free_netdev(dev);
>   			} else if (register_netdev(dev)<  0) {
>   				pr_err("Failed to register ethernet device "
>   					 "for interface %d, port %d\n",
>   					 interface, priv->port);
> -				kfree(dev);
> +				free_netdev(dev);
>   			} else {
>   				cvm_oct_device[priv->port] = dev;
>   				fau -=
> @@ -815,7 +815,7 @@ static void __exit cvm_oct_cleanup_module(void)
>
>   			cvm_oct_tx_shutdown_dev(dev);
>   			unregister_netdev(dev);
> -			kfree(dev);
> +			free_netdev(dev);
>   			cvm_oct_device[port] = NULL;
>   		}
>   	}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ