Netdev List
 help / color / mirror / Atom feed
From: Victor Nogueira <victor@mojatatu.com>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, jhs@mojatatu.com, jiri@resnulli.us,
	netdev@vger.kernel.org
Cc: horms@kernel.org, hybris@mojatatu.ai, sashiko-bot@kernel.org
Subject: [PATCH net-next 1/3] net/sched: act_mirred: account for TCA_MIRRED_BLOCKID in get_fill_size
Date: Sat, 19 Sep 2026 20:04:27 -0300	[thread overview]
Message-ID: <QDISC-RYTB.v1.20260918093205@mojatatu.com.1> (raw)
In-Reply-To: <QDISC-RYTB.v1.20260918093205@mojatatu.com>

tcf_mirred_get_fill_size budgets only TCA_MIRRED_PARMS, but 
tcf_mirred_dump also emits TCA_MIRRED_BLOCKID whenever the action was 
created with a block instead of a device, so the budget falls 8 bytes
short of what the dump may produce for such actions.

Account for TCA_MIRRED_BLOCKID unconditionally: reading tcfm_blockid to
size it conditionally would race a concurrent replace, which can flip the 
action between device and block between sizing and dumping.

Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260824153903.4143642-1-victor@mojatatu.com
Co-developed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Victor Nogueira <victor@mojatatu.com>
---
 net/sched/act_mirred.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index 553342c55cf7..1c98e4d81ebe 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -607,7 +607,8 @@ tcf_mirred_get_dev(const struct tc_action *a,
 
 static size_t tcf_mirred_get_fill_size(const struct tc_action *act)
 {
-	return nla_total_size(sizeof(struct tc_mirred));
+	return nla_total_size(sizeof(struct tc_mirred)) /* TCA_MIRRED_PARMS */
+		+ nla_total_size(sizeof(u32)); /* TCA_MIRRED_BLOCKID */
 }
 
 static void tcf_offload_mirred_get_dev(struct flow_action_entry *entry,
-- 
2.43.0


  reply	other threads:[~2026-09-19 23:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 23:04 [PATCH net-next 0/3] net/sched: complete action notification accounting Victor Nogueira
2026-09-19 23:04 ` Victor Nogueira [this message]
2026-09-19 23:04 ` [PATCH net-next 2/3] net/sched: add get_fill_size() to the five actions that lack one Victor Nogueira
2026-09-19 23:04 ` [PATCH net-next 3/3] net/sched: act_api: budget TCA_ROOT_EXT_WARN_MSG in notify skbs Victor Nogueira
2026-09-21 16:13 ` [PATCH net-next 0/3] net/sched: complete action notification accounting Simon Horman
2026-09-22 11:00 ` patchwork-bot+netdevbpf

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=QDISC-RYTB.v1.20260918093205@mojatatu.com.1 \
    --to=victor@mojatatu.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=hybris@mojatatu.ai \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sashiko-bot@kernel.org \
    /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