diff options
author | Vlad Buslov <vladbu@nvidia.com> | 2023-05-04 20:16:16 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-05-05 10:01:31 +0100 |
commit | fd741f0d9f702c193b2b44225c004f8c5d5be163 (patch) | |
tree | b1bd88643569881ff71174b82f00e9801d8069c3 /virt | |
parent | 5110f3ff6d3c986df9575c8da86630578b7f0846 (diff) |
net/sched: flower: fix error handler on replace
When replacing a filter (i.e. 'fold' pointer is not NULL) the insertion of
new filter to idr is postponed until later in code since handle is already
provided by the user. However, the error handling code in fl_change()
always assumes that the new filter had been inserted into idr. If error
handler is reached when replacing existing filter it may remove it from idr
therefore making it unreachable for delete or dump afterwards. Fix the
issue by verifying that 'fold' argument wasn't provided by caller before
calling idr_remove().
Fixes: 08a0063df3ae ("net/sched: flower: Move filter handle initialization earlier")
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Pedro Tammela <pctammela@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions