• Vlad Buslov's avatar
    net: sched: protect chain template accesses with block lock · a5654820
    Vlad Buslov authored
    When cls API is called without protection of rtnl lock, parallel
    modification of chain is possible, which means that chain template can be
    changed concurrently in certain circumstances. For example, when chain is
    'deleted' by new user-space chain API, the chain might continue to be used
    if it is referenced by actions, and can be 're-created' again by user. In
    such case same chain structure is reused and its template is changed. To
    protect from described scenario, cache chain template while holding block
    lock. Introduce standalone tc_chain_notify_delete() function that works
    with cached template values, instead of chains themselves.
    Signed-off-by: default avatarVlad Buslov <vladbu@mellanox.com>
    Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a5654820
cls_api.c 70.5 KB