]> git.baikalelectronics.ru Git - kernel.git/commit
niu: Fix kernel buffer overflow for ETHTOOL_GRXCLSRLALL
authorBen Hutchings <bhutchings@solarflare.com>
Tue, 7 Sep 2010 04:35:19 +0000 (04:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Sep 2010 21:01:52 +0000 (14:01 -0700)
commite74b3f06e47ac154dc18efd6f64c21d88a0bf126
tree12c53593c04b2c443029fe1a4b64393b3e6e92b9
parent62ca20eb80c07fe74a7517d39569384e9699df9a
niu: Fix kernel buffer overflow for ETHTOOL_GRXCLSRLALL

niu_get_ethtool_tcam_all() assumes that its output buffer is the right
size, and warns before returning if it is not.  However, the output
buffer size is under user control and ETHTOOL_GRXCLSRLALL is an
unprivileged ethtool command.  Therefore this is at least a local
denial-of-service vulnerability.

Change it to check before writing each entry and to return an error if
the buffer is already full.

Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/niu.c