Skip to content

net/sched Bind logic fixes for cls_fw, cls_u32 and cls_route

Jamal Hadi Salim netdev 1 version Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 3 repliesApplied 3/3

Changes in v2 from the cover letter

- Resubmission and SOB by Jamal

Patches in v2 All 3 applied

#Subject and filesSizeRepliesApplied
1/3net/sched: cls_u32: No longer copy tcf_result on update to avoid use-after-freenet/sched/cls_u32.c+0 -10 repliesApplied
2/3net/sched: cls_fw: No longer copy tcf_result on update to avoid use-after-freenet/sched/cls_fw.c+0 -10 repliesApplied
3/3net/sched: cls_route: No longer copy tcf_result on update to avoid use-after-freenet/sched/cls_route.c+0 -10 repliesApplied

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchVictor NogueiraPedro TammelaM A Ramdhan
SeriesR-b R-b T-b T-b R-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH net v2 0/3] net/sched Bind logic fixes for cls_fw, cls_u32 and cls_route

From: valis <[email protected]>

Three classifiers (cls_fw, cls_u32 and cls_route) always copy tcf_result struct into the new instance of the filter on update.

This causes a problem when updating a filter bound to a class, as tcf_unbind_filter() is always called on the old instance in the success path, decreasing filter_cnt of the still referenced class and allowing it to be deleted, leading to a use-after-free.

This patch set fixes this issue in all affected classifiers by no longer copying the tcf_result struct from the old filter.

v1 -> v2:
- Resubmission and SOB by Jamal

valis (3):
net/sched: cls_u32: No longer copy tcf_result on update to avoid
use-after-free
net/sched: cls_fw: No longer copy tcf_result on update to avoid
use-after-free
net/sched: cls_route: No longer copy tcf_result on update to avoid
use-after-free

 net/sched/cls_fw.c    | 1 -
 net/sched/cls_route.c | 1 -
 net/sched/cls_u32.c   | 1 -
 3 files changed, 3 deletions(-)

--
2.34.1