Skip to content

Commit 62ce44c

Browse files
author
Florian Westphal
committed
netfilter: ebtables: fix memory leak when blob is malformed
The bug fix was incomplete, it "replaced" crash with a memory leak. The old code had an assignment to "ret" embedded into the conditional, restore this. Fixes: 7997eff ("netfilter: ebtables: reject blobs that don't provide all entry points") Reported-and-tested-by: [email protected] Signed-off-by: Florian Westphal <[email protected]>
1 parent 9a4d6dd commit 62ce44c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/bridge/netfilter/ebtables.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,8 +1040,10 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl,
10401040
goto free_iterate;
10411041
}
10421042

1043-
if (repl->valid_hooks != t->valid_hooks)
1043+
if (repl->valid_hooks != t->valid_hooks) {
1044+
ret = -EINVAL;
10441045
goto free_unlock;
1046+
}
10451047

10461048
if (repl->num_counters && repl->num_counters != t->private->nentries) {
10471049
ret = -EINVAL;

0 commit comments

Comments
 (0)