diff options
author | Florian Westphal <fwestphal@astaro.com> | 2010-02-15 12:15:55 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-02-15 12:15:55 -0500 |
commit | 1756de262e41112a8a8927808eb2f03d21fd4786 (patch) | |
tree | 5cf74c0b735e6bcaa9b6dbded3ed91f43aaf6072 /net/bridge | |
parent | ef00f89f1eb7e056aab9dfe068521e6f2320c94a (diff) |
netfilter: ebtables: abort if next_offset is too small
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>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/netfilter/ebtables.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index bcdf02d866b8..4370e9680487 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
@@ -444,6 +444,8 @@ static int ebt_verify_pointers(const struct ebt_replace *repl, | |||
444 | break; | 444 | break; |
445 | if (left < e->next_offset) | 445 | if (left < e->next_offset) |
446 | break; | 446 | break; |
447 | if (e->next_offset < sizeof(struct ebt_entry)) | ||
448 | return -EINVAL; | ||
447 | offset += e->next_offset; | 449 | offset += e->next_offset; |
448 | } | 450 | } |
449 | } | 451 | } |