ethtool: Fix potential user buffer overflow for ETHTOOL_{G, S}RXFH
commit2a8b96d1e1100fbd27aaa69ea760dd10e38ab9cf
authorBen Hutchings <ben@decadent.org.uk>
Wed, 28 Jul 2010 22:59:18 +0000 (28 23:59 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:30:05 +0000 (2 10:30 -0700)
tree67aa88413477ff104e1bb0905d339c17d0b1ce2f
parent2ab40331614a9d8e07954602d4aee20bd3be78e0
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>
include/linux/ethtool.h
net/core/ethtool.c