summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2010-07-28 23:59:18 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-02 10:30:05 -0700
commit2a8b96d1e1100fbd27aaa69ea760dd10e38ab9cf (patch)
tree67aa88413477ff104e1bb0905d339c17d0b1ce2f /include/linux
parent2ab40331614a9d8e07954602d4aee20bd3be78e0 (diff)
ethtool: Fix potential user buffer overflow for ETHTOOL_{G, S}RXFH
commit bf988435bd5b53529f4408a8efb1f433f6ddfda9 upstream. struct ethtool_rxnfc was originally defined in 2.6.27 for the ETHTOOL_{G,S}RXFH command with only the cmd, flow_type and data fields. It was then extended in 2.6.30 to support various additional commands. These commands should have been defined to use a new structure, but it is too late to change that now. Since user-space may still be using the old structure definition for the ETHTOOL_{G,S}RXFH commands, and since they do not need the additional fields, only copy the originally defined fields to and from user-space. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ethtool.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index b33f316bb92e..d335ce351fbb 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -378,6 +378,8 @@ struct ethtool_rxnfc {
__u32 flow_type;
/* The rx flow hash value or the rule DB size */
__u64 data;
+ /* The following fields are not valid and must not be used for
+ * the ETHTOOL_{G,X}RXFH commands. */
struct ethtool_rx_flow_spec fs;
__u32 rule_cnt;
__u32 rule_locs[0];