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-next>] [day] [month] [year] [list]
Message-ID: <20110104232947.3451.91153.stgit@gitlad.jf.intel.com>
Date:	Tue, 04 Jan 2011 15:29:48 -0800
From:	Alexander Duyck <alexander.h.duyck@...el.com>
To:	davem@...emloft.net, bhutchings@...arflare.com
Cc:	netdev@...r.kernel.org
Subject: [net-next-2.6 PATCH] ethtool: update get_rx_ntuple to correctly
	interpret string count

Currently any strings returned via the get_rx_ntuple call will just be
dropped because the num_strings will be zero.  In order to correct this I
am updating things so that the return value of get_rx_ntuple is the number
of strings that were written, or a negative value if there was an error.

Signed-off-by: Alexander Duyck <alexander.h.duyck@...el.com>
---

 net/core/ethtool.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 1774178..7ade13b 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -587,6 +587,9 @@ static int ethtool_get_rx_ntuple(struct net_device *dev, void __user *useraddr)
 	if (ops->get_rx_ntuple) {
 		/* driver-specific filter grab */
 		ret = ops->get_rx_ntuple(dev, gstrings.string_set, data);
+		if (ret < 0)
+			goto out;
+		num_strings = ret;
 		goto copy;
 	}
 

--
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