Skip to content

Commit a3248b4

Browse files
committed
netfilter: ebtables: fix memory leak when blob is malformed
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2189550 Upstream Status: commit 62ce44c commit 62ce44c Author: Florian Westphal <[email protected]> Date: Tue Sep 20 14:20:17 2022 +0200 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]> Signed-off-by: Florian Westphal <[email protected]>
1 parent eaddfeb commit a3248b4

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
@@ -1005,8 +1005,10 @@ static int do_replace_finish(struct net *net, struct ebt_replace *repl,
10051005
goto free_iterate;
10061006
}
10071007

1008-
if (repl->valid_hooks != t->valid_hooks)
1008+
if (repl->valid_hooks != t->valid_hooks) {
1009+
ret = -EINVAL;
10091010
goto free_unlock;
1011+
}
10101012

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

0 commit comments

Comments
 (0)