lkml.org 
[lkml]   [2018]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 40/41] cls_flower: Fix incorrect idr release when failing to modify rule
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

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

    From: Paul Blakey <paulb@mellanox.com>

    [ Upstream commit 8258d2da9f9f521dce7019e018360c28d116354e ]

    When we fail to modify a rule, we incorrectly release the idr handle
    of the unmodified old rule.

    Fix that by checking if we need to release it.

    Fixes: fe2502e49b58 ("net_sched: remove cls_flower idr on failure")
    Reported-by: Vlad Buslov <vladbu@mellanox.com>
    Reviewed-by: Roi Dayan <roid@mellanox.com>
    Acked-by: Jiri Pirko <jiri@mellanox.com>
    Signed-off-by: Paul Blakey <paulb@mellanox.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    net/sched/cls_flower.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/net/sched/cls_flower.c
    +++ b/net/sched/cls_flower.c
    @@ -1007,7 +1007,7 @@ static int fl_change(struct net *net, st
    return 0;

    errout_idr:
    - if (fnew->handle)
    + if (!fold)
    idr_remove_ext(&head->handle_idr, fnew->handle);
    errout:
    tcf_exts_destroy(&fnew->exts);

    \
     
     \ /
      Last update: 2018-06-09 17:39    [W:4.102 / U:0.328 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site