lkml.org 
[lkml]   [2014]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.17 121/141] netfilter: ipset: off by one in ip_set_nfnl_get_byindex()
    Date
    3.17-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Dan Carpenter <dan.carpenter@oracle.com>

    commit 0f9f5e1b83abd2b37c67658e02a6fc9001831fa5 upstream.

    The ->ip_set_list[] array is initialized in ip_set_net_init() and it
    has ->ip_set_max elements so this check should be >= instead of >
    otherwise we are off by one.

    Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
    Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    net/netfilter/ipset/ip_set_core.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/net/netfilter/ipset/ip_set_core.c
    +++ b/net/netfilter/ipset/ip_set_core.c
    @@ -635,7 +635,7 @@ ip_set_nfnl_get_byindex(struct net *net,
    struct ip_set *set;
    struct ip_set_net *inst = ip_set_pernet(net);

    - if (index > inst->ip_set_max)
    + if (index >= inst->ip_set_max)
    return IPSET_INVALID_ID;

    nfnl_lock(NFNL_SUBSYS_IPSET);



    \
     
     \ /
      Last update: 2014-11-19 22:41    [W:4.215 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site