{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143196","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-12-03T03:10:28.359Z","datePublished":"2026-12-03T09:20:23.111Z","dateUpdated":"2026-12-04T03:30:39.403Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-12-04T03:30:39.403Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/mlx5: HWS, fix flow meter release on FTE update\n\nHWS has no duplicate match. When a flower filter is replaced in place,\nits new rule waits as the pending duplicate of the old FTE. Once the\nold rule goes, switch_to_pending_act_dests() copies the pending actions\nover the FTE before update_fte() releases the actions of the old rule.\nAn HWS rule reads the base id of its meter action through a pointer to\nthe exe_aso of the FTE. That release takes the meter action of the new\nrule instead.\n\nWhen the two meters sit in different ASO objects, the old meter action\nleaks. It keeps its ASO object referenced. The firmware then fails to\ndestroy that object and to free the PD of the meters, and its STC is\nstill in the pool when the context closes. The new meter action is\ndestroyed one release early, while a rule still points to it, and the\nlast release underflows its refcount:\n\n  mlx5_core 0000:b1:00.1: mlx5_cmd_out_err:822:(pid 2641): DESTROY_GENERAL_OBJECT(0xa03) op_mod(0x24) failed, status bad resource(0x5), syndrome (0xeeda5c), err(-22)\n  refcount_t: underflow; use-after-free.\n  WARNING: lib/refcount.c:96 at refcount_dec_not_one+0x3f/0x60, CPU#43: tc/2641\n  Call Trace:\n   <TASK>\n   mlx5_fs_put_hws_action.part.0+0x1a/0xa0 [mlx5_core]\n   mlx5_fs_destroy_fs_actions+0xa8/0x110 [mlx5_core]\n   mlx5_cmd_hws_delete_fte+0x49/0x90 [mlx5_core]\n   del_hw_fte+0x209/0x320 [mlx5_core]\n   mlx5_del_flow_rules+0x10b/0x260 [mlx5_core]\n   __mlx5_eswitch_del_rule+0x5c/0x1b0 [mlx5_core]\n   mlx5_eswitch_del_offloaded_rule+0x10/0x20 [mlx5_core]\n   mlx5e_tc_rule_unoffload+0x4b/0x100 [mlx5_core]\n   mlx5e_tc_unoffload_fdb_rules+0x35/0x80 [mlx5_core]\n   mlx5e_tc_del_fdb_flow+0x2ca/0x310 [mlx5_core]\n   mlx5e_tc_del_flow+0x5d/0x2d0 [mlx5_core]\n   mlx5e_flow_put+0x3a/0x80 [mlx5_core]\n   mlx5e_delete_flower+0x291/0x460 [mlx5_core]\n   mlx5e_setup_tc_block_cb+0xc4/0x110 [mlx5_core]\n   tc_setup_cb_destroy+0xcc/0x1b0\n   fl_hw_destroy_filter+0xa1/0xe0 [cls_flower]\n   __fl_delete+0x2d0/0x3d0 [cls_flower]\n   fl_destroy+0xbd/0x160 [cls_flower]\n   tcf_proto_destroy+0x3b/0x110\n   tcf_proto_put+0x3d/0x70\n   tc_del_tfilter+0x362/0x8f0\n   rtnetlink_rcv_msg+0x384/0x460\n   netlink_rcv_skb+0x61/0x120\n   rtnetlink_rcv+0x15/0x30\n   netlink_unicast+0x2a1/0x3d0\n   netlink_sendmsg+0x237/0x490\n   ____sys_sendmsg+0x33b/0x360\n   ___sys_sendmsg+0x99/0xf0\n   __sys_sendmsg+0x93/0x100\n   __x64_sys_sendmsg+0x1d/0x30\n   x64_sys_call+0x821/0x23d0\n   do_syscall_64+0xba/0x550\n   entry_SYSCALL_64_after_hwframe+0x76/0x7e\n   </TASK>\n  mlx5_core 0000:b1:00.1: mlx5_cmd_out_err:822:(pid 2642): DEALLOC_PD(0x801) op_mod(0x0) failed, status bad resource state(0x9), syndrome (0xef0c8a), err(-22)\n  mlx5_core 0000:b1:00.1: mlx5hws_pool_destroy:386:(pid 2642): Attempting to destroy non-empty pool\n\nKeep the base id in the rule action, as the sampler id is.\n\nDiscovered while stress testing a 5G UPF kernel code. Without this fix,\nthe reproduction below gives the trace above on a ConnectX-7 with\nfirmware 28.48.1000. It only uses tc and devlink, with no kernel\nchange. 129 meters cannot fit in one ASO object. DEV is the uplink\nrepresentor and PCI its devlink handle:\n\n  r() { echo \"filter $1 dev $DEV ingress prio 1 handle $2 protocol ip flower skip_sw dst_ip 10.0.0.$2 action police index $3 rate 1mbit burst 32k conform-exceed drop/pipe action drop\"; }\n  devlink dev param set $PCI name flow_steering_mode value hmfs cmode runtime\n  devlink dev eswitch set $PCI mode switchdev\n  tc qdisc add dev $DEV ingress\n  for i in $(seq 129); do r add $i $i; done | tc -b -\n  r replace 1 1000 | tc -b -\n  tc filter del dev $DEV ingress prio 1\n  devlink dev eswitch set $PCI mode legacy\n\nWith this fix, the reproduction runs clean on the same ConnectX-7.\nIt was not tested against kernel selftests."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - Flower replace reaches the bug through a local rtnetlink sendmsg: tc_new_tfilter/fl_change calls fl_hw_replace_filter then fl_hw_destroy_filter, and mlx5e_setup_tc_block_cb leads to del_hw_fte and mlx5_cmd_hws_update_fte. The police index is in that netlink message; no packet or remote protocol field is parsed.\nAC:H - mlx5_cmd_hws_update_fte is installed only for an HMFS FDB namespace, and mlx5_eswitch_add_offloaded_rule returns -EOPNOTSUPP unless the eswitch is in offloads mode. mlx5_fs_core_alloc prefers SMFS when DR is supported, and devlink PARAM_SET and ESWITCH_SET are GENL_ADMIN_PERM, so a netns CAP_NET_ADMIN caller cannot select hmfs.\nPR:L - rtnetlink_rcv_msg gates RTM_NEWTFILTER and RTM_DELTFILTER with netlink_net_capable(CAP_NET_ADMIN) against the socket netns user_ns. mlx5e_setup_tc_block_cb adds no init_user_ns check, so CAP_NET_ADMIN in a delegated netns that contains the mlx5 representor can replace and delete the flower filter.\nUI:N - The attacker sends the flower replace and the later filter delete that calls mlx5_cmd_hws_delete_fte. No other user has to mount media, open a file, or emit a packet.\nS:U - mlx5hws_action_destroy kfrees a host-kernel mlx5hws_action in the mlx5 driver. The dangling use stays inside that host kernel and does not cross a guest, IOMMU, or sandbox boundary.\nC:H - The saved rule action holds &fte->act_dests.action.exe_aso, which switch_to_pending_act_dests overwrites before the put, so mlx5_fs_put_hws_action kfrees the new meter's mlx5hws_action while hws_fs_actions[].action still points at it. mlx5hws_action_get_type then reads action->type from that freed object.\nI:H - On delete, mlx5_fs_destroy_fs_action switches on the reclaimed action->type and, for any type other than CTR, ASO_METER, or SAMPLER, calls mlx5hws_action_destroy, whose DEST_ARRAY and RANGE arms kfree and firmware-destroy through pointers taken from the freed mlx5hws_action.\nA:H - The early put destroys the live rule's STC in hws_action_destroy_stcs and frees the action. The matching delete then calls mlx5hws_action_get_type on that pointer and mlx5_fs_put_hws_action hits refcount_dec_not_one on a zero hws_action_refcount, which warns and can fault if the slab slot was reused or poisoned."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c","drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.h"],"versions":[{"version":"82d3639ef7dc54d5b5cb454d9a13005202d7a701","lessThan":"087f9763557bad13d5de65e3dbf1a018ba6164c2","status":"affected","versionType":"git"},{"version":"82d3639ef7dc54d5b5cb454d9a13005202d7a701","lessThan":"f534116da01c1dac9a5484df439b6ffabb02ae90","status":"affected","versionType":"git"},{"version":"82d3639ef7dc54d5b5cb454d9a13005202d7a701","lessThan":"145480b28ca82e9fae789427cc4569e596515a32","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c","drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.h"],"versions":[{"version":"6.15","status":"affected"},{"version":"0","lessThan":"6.15","status":"unaffected","versionType":"semver"},{"version":"6.18.66","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.7","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc3","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.15","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.15","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.15","versionEndExcluding":"7.4-rc3"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/087f9763557bad13d5de65e3dbf1a018ba6164c2"},{"url":"https://git.kernel.org/stable/c/f534116da01c1dac9a5484df439b6ffabb02ae90"},{"url":"https://git.kernel.org/stable/c/145480b28ca82e9fae789427cc4569e596515a32"}],"title":"net/mlx5: HWS, fix flow meter release on FTE update","x_generator":{"engine":"bippy-1.2.0"}}}}