From: Paul Moses <p@1g4.org>
To: netdev@vger.kernel.org
Cc: Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>,
Jiri Pirko <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
linux-kernel@vger.kernel.org, Paul Moses <p@1g4.org>,
stable@vger.kernel.org
Subject: [PATCH net v3 1/7] net/sched: act_gate: zero-initialize netlink dump struct
Date: Wed, 21 Jan 2026 13:20:35 +0000 [thread overview]
Message-ID: <20260121131954.2710459-2-p@1g4.org> (raw)
In-Reply-To: <20260121131954.2710459-1-p@1g4.org>
Zero-initialize the dump struct before selective assignment to avoid
leaking stack padding in netlink replies. This matches other actions
(e.g. act_connmark) that zero-init their dump structs.
Fixes: a51c328df310 ("net: qos: introduce a gate control flow action")
Cc: stable@vger.kernel.org
Signed-off-by: Paul Moses <p@1g4.org>
---
net/sched/act_gate.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/sched/act_gate.c b/net/sched/act_gate.c
index c1f75f2727576..aacd57e5f4374 100644
--- a/net/sched/act_gate.c
+++ b/net/sched/act_gate.c
@@ -499,16 +499,16 @@ static int tcf_gate_dump(struct sk_buff *skb, struct tc_action *a,
{
unsigned char *b = skb_tail_pointer(skb);
struct tcf_gate *gact = to_gate(a);
- struct tc_gate opt = {
- .index = gact->tcf_index,
- .refcnt = refcount_read(&gact->tcf_refcnt) - ref,
- .bindcnt = atomic_read(&gact->tcf_bindcnt) - bind,
- };
+ struct tc_gate opt = { };
struct tcfg_gate_entry *entry;
struct tcf_gate_params *p;
struct nlattr *entry_list;
struct tcf_t t;
+ opt.index = gact->tcf_index;
+ opt.refcnt = refcount_read(&gact->tcf_refcnt) - ref;
+ opt.bindcnt = atomic_read(&gact->tcf_bindcnt) - bind;
+
spin_lock_bh(&gact->tcf_lock);
opt.action = gact->tcf_action;
--
2.52.GIT
next parent reply other threads:[~2026-01-21 13:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260121131954.2710459-1-p@1g4.org>
2026-01-21 13:20 ` Paul Moses [this message]
2026-01-21 13:25 ` [PATCH net v3 1/7] net/sched: act_gate: zero-initialize netlink dump struct Eric Dumazet
2026-01-21 13:39 ` Paul Moses
2026-01-21 13:48 ` Eric Dumazet
2026-01-21 14:01 ` Paul Moses
2026-01-21 14:03 ` Eric Dumazet
2026-01-21 15:26 ` Paul Moses
2026-01-21 15:46 ` Eric Dumazet
2026-01-21 13:20 ` [PATCH net v3 2/7] net/sched: act_gate: add RCU support for parameter update Paul Moses
2026-01-21 19:42 ` Victor Nogueira
2026-01-22 15:51 ` Paul Moses
2026-01-21 13:20 ` [PATCH net v3 3/7] net/sched: act_gate: build schedule and RCU-swap Paul Moses
2026-01-21 19:43 ` Victor Nogueira
2026-01-21 13:20 ` [PATCH net v3 4/7] net/sched: act_gate: read schedule via RCU Paul Moses
2026-01-21 19:44 ` Victor Nogueira
2026-01-21 13:20 ` [PATCH net v3 5/7] net/sched: act_gate: cancel timer outside tcf_lock Paul Moses
2026-01-21 13:20 ` [PATCH net v3 6/7] net/sched: act_gate: reject empty schedule list Paul Moses
2026-01-21 19:44 ` Victor Nogueira
2026-01-21 21:48 ` Victor Nogueira
2026-01-26 8:53 ` Paul Moses
2026-01-26 12:05 ` Victor Nogueira
2026-01-31 15:00 ` Paul Moses
2026-02-02 12:44 ` Victor Nogueira
2026-01-21 13:21 ` [PATCH net v3 7/7] net/sched: act_gate: guard NULL params in accessors Paul Moses
2026-01-21 19:47 ` Victor Nogueira
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=20260121131954.2710459-2-p@1g4.org \
--to=p@1g4.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=xiyou.wangcong@gmail.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