summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTodd Kjos <tkjos@google.com>2021-08-17 13:29:23 -0700
committerTodd Kjos <tkjos@google.com>2021-08-20 22:58:10 +0000
commiteeb0ab66f7532a3b451ec98325cc8c91e27ba69d (patch)
tree3995d019528aeca9ff7096719c1b31eefd20f35a /net
parentd4e9776f69fb14fc1fe01f1db0b95d2054866293 (diff)
ANDROID: xt_quota2: clear quota2_log message before sending
Initialize message buffer for quota2_log to avoid sending random data. Bug: 196046570 Test: passed netd test suites Fixes: 10cda83af99d ("ANDROID: netfilter: xt_quota2: adding the original quota2 from xtables-addons") Signed-off-by: Todd Kjos <tkjos@google.com> Change-Id: Ic9f34aaa2593809b375fc649b74567190c99dc62
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/xt_quota2.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/net/netfilter/xt_quota2.c b/net/netfilter/xt_quota2.c
index d4fcf00d4400..c081e7ff0c54 100644
--- a/net/netfilter/xt_quota2.c
+++ b/net/netfilter/xt_quota2.c
@@ -106,23 +106,16 @@ static void quota2_log(unsigned int hooknum,
return;
}
pm = nlmsg_data(nlh);
+ memset(pm, 0, sizeof(*pm));
if (skb->tstamp.tv64 == 0)
__net_timestamp((struct sk_buff *)skb);
- pm->data_len = 0;
pm->hook = hooknum;
if (prefix != NULL)
strlcpy(pm->prefix, prefix, sizeof(pm->prefix));
- else
- *(pm->prefix) = '\0';
if (in)
strlcpy(pm->indev_name, in->name, sizeof(pm->indev_name));
- else
- pm->indev_name[0] = '\0';
-
if (out)
strlcpy(pm->outdev_name, out->name, sizeof(pm->outdev_name));
- else
- pm->outdev_name[0] = '\0';
NETLINK_CB(log_skb).dst_group = 1;
pr_debug("throwing 1 packets to netlink group 1\n");