niu: Fix kernel buffer overflow for ETHTOOL_GRXCLSRLALL
commit ee9c5cfad29c8a13199962614b9b16f1c4137ac9 upstream.
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
Change it to check before writing each entry and to return an error if
the buffer is already full.
Signed-off-by: Ben Hutchings <firstname.lastname@example.org>
Signed-off-by: David S. Miller <email@example.com>
Signed-off-by: Paul Gortmaker <firstname.lastname@example.org>
1 file changed