use vzalloc() instead of vmalloc() as counterstmp is not cleared before it is used in get_counters(). counterstmp might be leaked partially when it is sent to userland later on.
Subsystems (4)
PATCH 1/1 use vzalloc() instead of vmalloc() as counterstmp is not cleared before it is used in get_counters(). counterstmp might be leaked partially when it is sent to userland later on.
--- net/bridge/netfilter/ebtables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/bridge/netfilter/ebtables.c +2 -2
@@ -989,7 +989,7 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl,the check on the size is done later, when we have the lock */ if (repl->num_counters) {unsigned long size = repl->num_counters *sizeof (*counterstmp); - counterstmp =vmalloc (size); + counterstmp =vzalloc (size);if (!counterstmp)return -ENOMEM ; }
@@ -1410,7 +1410,7 @@ static int copy_counters_to_user(struct ebt_table *t,return -EINVAL ; } - counterstmp =vmalloc (nentries *sizeof (*counterstmp)); + counterstmp =vzalloc (nentries *sizeof (*counterstmp));if (!counterstmp)return -ENOMEM ;
Signature · 1 line
2.6.1