projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bbdc176
)
[NETFILTER]: ebtables: don't compute gap before checking struct type
author
Chuck Ebbert
<
[email protected]
>
Thu, 4 Jan 2007 20:17:44 +0000
(12:17 -0800)
committer
David S. Miller
<
[email protected]
>
Thu, 4 Jan 2007 20:17:44 +0000
(12:17 -0800)
We cannot compute the gap until we know we have a 'struct ebt_entry' and
not 'struct ebt_entries'. Failure to check can cause crash.
Tested-by: Santiago Garcia Mantinan <
[email protected]
>
Acked-by: Al Viro <
[email protected]
>
Signed-off-by: Chuck Ebbert <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Patrick McHardy <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/bridge/netfilter/ebtables.c
patch
|
blob
|
history
diff --git
a/net/bridge/netfilter/ebtables.c
b/net/bridge/netfilter/ebtables.c
index bee558a41800e2700a4f00e84e06224f57d368b0..6c84ccb8c9d754d045bc6351812917f6cfbd3cb3 100644
(file)
--- a/
net/bridge/netfilter/ebtables.c
+++ b/
net/bridge/netfilter/ebtables.c
@@
-610,7
+610,7
@@
ebt_check_entry(struct ebt_entry *e, struct ebt_table_info *newinfo,
struct ebt_entry_target *t;
struct ebt_target *target;
unsigned int i, j, hook = 0, hookmask = 0;
- size_t gap
= e->next_offset - e->target_offset
;
+ size_t gap;
int ret;
/* don't mess with the struct ebt_entries */
@@
-660,6
+660,7
@@
ebt_check_entry(struct ebt_entry *e, struct ebt_table_info *newinfo,
if (ret != 0)
goto cleanup_watchers;
t = (struct ebt_entry_target *)(((char *)e) + e->target_offset);
+ gap = e->next_offset - e->target_offset;
target = find_target_lock(t->u.name, &ret, &ebt_mutex);
if (!target)
goto cleanup_watchers;