lkml.org 
[lkml]   [2016]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.10 010/180] netfilter: x_tables: assert minimum target size
    Date
    From: Florian Westphal <fw@strlen.de>

    commit a08e4e190b866579896c09af59b3bdca821da2cd upstream.

    The target size includes the size of the xt_entry_target struct.

    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Willy Tarreau <w@1wt.eu>
    ---
    net/netfilter/x_tables.c | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
    index 55b1e0c..cc34bb3 100644
    --- a/net/netfilter/x_tables.c
    +++ b/net/netfilter/x_tables.c
    @@ -587,6 +587,9 @@ int xt_check_entry_offsets(const void *base,
    return -EINVAL;

    t = (void *)(e + target_offset);
    + if (t->u.target_size < sizeof(*t))
    + return -EINVAL;
    +
    if (target_offset + t->u.target_size > next_offset)
    return -EINVAL;

    --
    2.8.0.rc2.1.gbe9624a
    \
     
     \ /
      Last update: 2016-09-17 09:57    [W:4.541 / U:0.188 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site