Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tariq Toukan" <tariqt@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH net] net/mlx5e: TC, Fix parse_attr leak on branch attr alloc failure
Date: Thu, 26 Nov 2026 12:29:13 +0000	[thread overview]
Message-ID: <sashiko-outbox-235503@kernel.org> (raw)
In-Reply-To: <20261126122316.599831-1-tariqt@nvidia.com>

> alloc_branch_attr() gets the branch attribute from
> mlx5e_clone_flow_attr_for_post_act(), which also allocates its
> parse_attr. When the branch action cannot be offloaded, the error path
> frees the attribute but not its parse_attr, leaking it.
> 
> This happens, for example, when a police action's conform and exceed
> actions are both jumps: the exceed action fails with "Cannot offload
> flows with nested jumps".
> 
> Free the parse_attr too.
> 
> Found by LLM-assisted code inspection, while reviewing a fix for a
> double free on the same error path.
> 
> Reproduced on ConnectX-6 Dx in switchdev mode, with kmemleak, by
> failing 50 times to offload such a filter on the uplink representor:
> 
>   tc filter add dev $UPLINK ingress protocol ip flower skip_sw \
>           dst_ip 192.0.2.2 action police rate 1mbit burst 20k \
>           conform-exceed jump 1 / jump 1 action pass action drop
> 
> Without this patch, kmemleak reported 29 unreferenced 4096-byte
> objects, all allocated by mlx5e_clone_flow_attr_for_post_act() from
> alloc_branch_attr(). With it, kmemleak reported none.
> 
> Fixes: f86488cb4685 ("net/mlx5e: TC, initialize branch flow attributes")
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126122316.599831-1-tariqt@nvidia.com?part=1

      reply	other threads:[~2026-11-26 12:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 12:23 [PATCH net] net/mlx5e: TC, Fix parse_attr leak on branch attr alloc failure Tariq Toukan
2026-11-26 12:29 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-235503@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tariqt@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox