aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-10-07 07:40:17 -0400
committerDavid S. Miller <davem@davemloft.net>2018-10-07 21:02:37 -0700
commit6d4c407744dd0338da5d5d76f40dce5adabfb30a (patch)
tree8afe5a3ad64997e213fb77a790033a98c2b5a267 /tools/perf/scripts
parentudp: Unbreak modules that rely on external __skb_recv_udp() availability (diff)
downloadlinux-6d4c407744dd0338da5d5d76f40dce5adabfb30a.tar.gz
linux-6d4c407744dd0338da5d5d76f40dce5adabfb30a.zip
net: sched: cls_u32: fix hnode refcounting
cls_u32.c misuses refcounts for struct tc_u_hnode - it counts references via ->hlist and via ->tp_root together. u32_destroy() drops the former and, in case when there had been links, leaves the sucker on the list. As the result, there's nothing to protect it from getting freed once links are dropped. That also makes the "is it busy" check incapable of catching the root hnode - it *is* busy (there's a reference from tp), but we don't see it as something separate. "Is it our root?" check partially covers that, but the problem exists for others' roots as well. AFAICS, the minimal fix preserving the existing behaviour (where it doesn't include oopsen, that is) would be this: * count tp->root and tp_c->hlist as separate references. I.e. have u32_init() set refcount to 2, not 1. * in u32_destroy() we always drop the former; in u32_destroy_hnode() - the latter. That way we have *all* references contributing to refcount. List removal happens in u32_destroy_hnode() (called only when ->refcnt is 1) an in u32_destroy() in case of tc_u_common going away, along with everything reachable from it. IOW, that way we know that u32_destroy_key() won't free something still on the list (or pointed to by someone's ->root). Reproducer: tc qdisc add dev eth0 ingress tc filter add dev eth0 parent ffff: protocol ip prio 100 handle 1: \ u32 divisor 1 tc filter add dev eth0 parent ffff: protocol ip prio 200 handle 2: \ u32 divisor 1 tc filter add dev eth0 parent ffff: protocol ip prio 100 \ handle 1:0:11 u32 ht 1: link 801: offset at 0 mask 0f00 shift 6 \ plus 0 eat match ip protocol 6 ff tc filter delete dev eth0 parent ffff: protocol ip prio 200 tc filter change dev eth0 parent ffff: protocol ip prio 100 \ handle 1:0:11 u32 ht 1: link 0: offset at 0 mask 0f00 shift 6 plus 0 \ eat match ip protocol 6 ff tc filter delete dev eth0 parent ffff: protocol ip prio 100 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/perf/scripts')
0 files changed, 0 insertions, 0 deletions
td>-14/+20 2022-06-16drm/vc4: crtc: Use an union to store the page flip callbackMaxime Ripard1-6/+14 2022-06-16drm/vc4: drv: Skip BO Backend Initialization on BCM2711Maxime Ripard1-7/+11 2022-06-16drm/vc4: plane: Register a different drm_plane_helper_funcs on BCM2711Maxime Ripard1-1/+11 2022-06-16drm/vc4: kms: Register a different drm_mode_config_funcs on BCM2711Maxime Ripard1-1/+7 2022-06-16drm/vc4: drv: Register a different driver on BCM2711Maxime Ripard1-9/+42 2022-06-16drm/vc4: bo: Split out Dumb buffers fixupMaxime Ripard3-6/+17 2022-06-16drm/vc4: bo: Rename vc4_dumb_createMaxime Ripard3-7/+7 2022-06-16drm/vc4: Consolidate Hardware Revision CheckMaxime Ripard6-29/+30 2022-06-16drm/vc4: plane: Prevent async update if we don't have a dlistMaxime Ripard1-0/+4 2022-06-16drm/sun4i: Fix crash during suspend after component bind failureSamuel Holland1-1/+3 2022-06-16drm/sun4i: dw-hdmi: Fix ddc-en GPIO consumer conflictSamuel Holland2-52/+4 2022-06-14drm/ttm: fix bulk move handling v2Christian König3-28/+54 2022-06-10drm/ttm: fix missing NULL check in ttm_device_swapoutChristian König1-1/+5 2022-06-09drm/atomic: fix warning of unused variableGONG, Ruiqi1-0/+1 2022-06-09drm/ast: Support multiple outputsThomas Zimmermann6-36/+41 2022-06-06drm/atomic: Force bridge self-refresh-exit on CRTC switchBrian Norris1-3/+13 2022-06-06drm/bridge: analogix_dp: Support PSR-exit to disable transitionBrian Norris1-4/+38 2022-06-05Linux 5.19-rc1v5.19-rc1Linus Torvalds1-2/+2 2022-06-05bluetooth: don't use bitmaps for random flag accessesLinus Torvalds5-39/+27 2022-06-05fix the breakage in close_fd_get_file() calling conventions changeAl Viro3-6/+4 2022-06-05kbuild: Allow to select bash in a modified environmentSchspa Shi1-1/+1 2022-06-05scripts: kconfig: nconf: make nconfig accept jk keybindingsIsak Ellmer1-2/+6 2022-06-05modpost: use fnmatch() to simplify match()Masahiro Yamada1-61/+13 2022-06-05modpost: simplify mod->name allocationMasahiro Yamada1-13/+12 2022-06-05kbuild: factor out the common objtool argumentsMasahiro Yamada4-97/+52 2022-06-05kbuild: move vmlinux.o link to scripts/Makefile.vmlinux_oMasahiro Yamada2-40/+62 2022-06-05kbuild: clean .tmp_* pattern by make cleanMasahiro Yamada3-8/+5 2022-06-04cifs: fix uninitialized pointer in error case in dfs_cache_get_tgt_shareSteve French1-1/+2 2022-06-04parisc/stifb: Keep track of hardware path of graphics cardHelge Deller3-9/+14 2022-06-04parisc/stifb: Implement fb_is_primary_device()Helge Deller3-2/+23 2022-06-03firmware_loader: enable XZ by default if compressed support is enabledLinus Torvalds1-0/+1 2022-06-03perf vendor events intel: Update metrics for AlderlakeZhengjun Xing1-50/+113