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]
Date:	Wed, 10 Feb 2010 19:54:45 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	jeffrey.t.kirsher@...el.com
Cc:	netdev@...r.kernel.org, gospo@...hat.com,
	peter.p.waskiewicz.jr@...el.com
Subject: Re: [net-next-2.6 PATCH v5 0/3] Introduce n-tuple ethtool support

From: Jeff Kirsher <jeffrey.t.kirsher@...el.com>
Date: Wed, 10 Feb 2010 18:07:18 -0800

> One more round of fixes, based on feedback from Patrick McHardy
> 
> 1) Change the list count to an unsigned value
> 2) Fix a memory leak
> 3) Removed an unnecessary list traversal in the ethtool core
> 4) Moved all list destruction to a helper function, allowing the driver
> to control when it clears the list (aside from when free_netdev() kills
> the cached list).

All applied, thanks.

Pj, can you look a shoring up the behavior of one more thing for me?

When rules get added, it first installs the filter by calling into
the driver.

_Then_ is tries to add the software copy of the rule to the device
list.  This does an allocation which may fail.

If it does fail, we return -ENOMEM but we left the device configured
with the new rule.

Probably better to do it something like:

	p = NULL;
	if (need_sw_rule_list)
		p = alloc_rule();
		if (!p)
			return -ENOMEM;
	}

	ret = op->install_rule();
	if (ret) {
		kfree(p);
		return ret;
	}
	
	if (need_sw_rule_list)
		sw_rule_insert(dev, p);

You get the idea, we can do the kfree() unconditonally because kfree(NULL)
is OK, etc.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ