Skip to content

Commit

Permalink
netfilter: ebtables: abort if next_offset is too small
Browse files Browse the repository at this point in the history
next_offset must be > 0, otherwise this loops forever.
The offset also contains the size of the ebt_entry structure
itself, so anything smaller is invalid.

Signed-off-by: Florian Westphal <fwestphal@astaro.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Florian Westphal authored and Patrick McHardy committed Feb 15, 2010
1 parent ef00f89 commit 1756de2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/bridge/netfilter/ebtables.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ static int ebt_verify_pointers(const struct ebt_replace *repl,
break;
if (left < e->next_offset)
break;
if (e->next_offset < sizeof(struct ebt_entry))
return -EINVAL;
offset += e->next_offset;
}
}
Expand Down

0 comments on commit 1756de2

Please sign in to comment.