Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=44f9a2fdc48ccb8bb510b6e1210bf15b3e10afdb
Commit:     44f9a2fdc48ccb8bb510b6e1210bf15b3e10afdb
Parent:     bbdc176a2f39913063aaaf95bc27e4b18fd14953
Author:     Chuck Ebbert <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 4 12:17:44 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Jan 4 12:17:44 2007 -0800

    [NETFILTER]: ebtables: don't compute gap before checking struct type
    
    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 |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index bee558a..6c84ccb 100644
--- 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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to