From b17dcb99726427b6f7a26be8c46023c5d7d15e08 Mon Sep 17 00:00:00 2001 From: Alexander Duyck Date: Fri, 13 Jul 2012 09:55:29 -0700 Subject: ethtool: Resolve use of uninitialized memory in rxclass_get_dev_info The ethtool function for getting the rule count was not zeroing out the data field before passing it to the kernel. As a result the value started uninitialized and was incorrectly returning a result indicating that devices supported setting new rule indexes. In order to correct this I am adding a one line fix that sets data to zero before we pass the command to the kernel. Signed-off-by: Alexander Duyck Signed-off-by: Ben Hutchings --- rxclass.c | 1 + 1 file changed, 1 insertion(+) (limited to 'rxclass.c') diff --git a/rxclass.c b/rxclass.c index 4d49aa6..e1633a8 100644 --- a/rxclass.c +++ b/rxclass.c @@ -207,6 +207,7 @@ static int rxclass_get_dev_info(struct cmd_context *ctx, __u32 *count, int err; nfccmd.cmd = ETHTOOL_GRXCLSRLCNT; + nfccmd.data = 0; err = send_ioctl(ctx, &nfccmd); *count = nfccmd.rule_cnt; if (driver_select) -- cgit v1.2.1