Netdev List
 help / color / mirror / Atom feed
* [PATCH net v2 0/3] net/sched: u32_change() fixes
@ 2026-08-13 12:22 Jedrzej Jagielski
  2026-08-13 12:22 ` [PATCH net v2 1/3] net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of flags Jedrzej Jagielski
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Jedrzej Jagielski @ 2026-08-13 12:22 UTC (permalink / raw)
  To: netdev; +Cc: anthony.l.nguyen, kuba, jhs, jiri, edumazet, Jedrzej Jagielski

sorry for spam, previous series get treated as incomplete so resending

ALREADY ON NETDEV, SASHIKO RUN

This series fixes three bugs in cls_u32's u32_change() function:

Patch 1 fixes u32_replace_hw_knode() being fed the wrong flags variable.
Commit 695176bfe5de ("net_sched: refactor TC action init API") introduced
a function parameter `flags` that shadowed the local variable previously
set from TCA_U32_FLAGS. This caused tc_skip_sw() to always return false
during offload, silently ignoring skip_sw/skip_hw attributes. This fix
uncovered following 2 issues happening on u32_replace_hw_knode()
failure.

Patch 2 fixes a refcount leak of the linked hash table (n->ht_down) when
creating a new filter and u32_replace_hw_knode() fails. The error path
frees the node with kfree() but never drops the reference acquired by
u32_set_parms(), leaking the tc_u_hnode.

Patch 3 removes a spurious refcount_inc() in the update error path added
by commit e8d3d78c19be ("net: sched: cls_u32: Undo refcount decrement in
case update failed"). That commit misidentified an already-balanced
refcount (incremented by u32_init_knode, decremented by u32_set_parms)
as needing restoration on failure. The extra increment has no matching
decrement, permanently elevating the hash table's refcount.

Jedrzej Jagielski (3):
  net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of
    flags
  net/sched: cls_u32: fix linked hash table refcount leak
  net/sched: cls_u32: remove erroneous refcount_inc()

 net/sched/cls_u32.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-08-18  9:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 12:22 [PATCH net v2 0/3] net/sched: u32_change() fixes Jedrzej Jagielski
2026-08-13 12:22 ` [PATCH net v2 1/3] net/sched: cls_u32: feed u32_replace_hw_knode() with correct set of flags Jedrzej Jagielski
2026-08-18  9:51   ` Paolo Abeni
2026-08-13 12:22 ` [PATCH net v2 2/3] net/sched: cls_u32: fix linked hash table refcount leak Jedrzej Jagielski
2026-08-18  9:51   ` Paolo Abeni
2026-08-13 12:22 ` [PATCH net v2 3/3] net/sched: cls_u32: remove erroneous refcount_inc() Jedrzej Jagielski
2026-08-17 12:42 ` [PATCH net v2 0/3] net/sched: u32_change() fixes Przemek Kitszel
2026-08-18  7:46   ` Jagielski, Jedrzej
2026-08-18  9:51     ` Jamal Hadi Salim
2026-08-18  9:55     ` Paolo Abeni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox