lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM0EoM=jOWv+xmDx_+=_Cq2t5S731b3uny=DWrVX4nba3yjv7w@mail.gmail.com>
Date: Sun, 2 Mar 2025 15:49:29 -0500
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Stanislav Fomichev <sdf@...ichev.me>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com, 
	kuba@...nel.org, pabeni@...hat.com, Cong Wang <xiyou.wangcong@...il.com>, 
	Jiri Pirko <jiri@...nulli.us>, Saeed Mahameed <saeed@...nel.org>
Subject: Re: [PATCH net-next v10 03/14] net: sched: wrap doit/dumpit methods

On Sat, Mar 1, 2025 at 7:09 PM Stanislav Fomichev <sdf@...ichev.me> wrote:
>
> In preparation for grabbing netdev instance lock around qdisc
> operations, introduce tc_xxx wrappers that lookup netdev
> and call respective __tc_xxx helper to do the actual work.
> No functional changes.
>
> Cc: Jamal Hadi Salim <jhs@...atatu.com>
> Cc: Cong Wang <xiyou.wangcong@...il.com>
> Cc: Jiri Pirko <jiri@...nulli.us>
> Cc: Saeed Mahameed <saeed@...nel.org>
> Signed-off-by: Stanislav Fomichev <sdf@...ichev.me>
> ---
>  net/sched/sch_api.c | 190 ++++++++++++++++++++++++++++----------------
>  1 file changed, 122 insertions(+), 68 deletions(-)
>
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index e3e91cf867eb..e0be3af4daa9 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -1505,27 +1505,18 @@ const struct nla_policy rtm_tca_policy[TCA_MAX + 1] = {
>   * Delete/get qdisc.
>   */
>
[..]
> +static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
> +                          struct netlink_ext_ack *extack)
> +{
> +       struct net *net = sock_net(skb->sk);
> +       struct tcmsg *tcm = nlmsg_data(n);
> +       struct nlattr *tca[TCA_MAX + 1];
> +       struct net_device *dev;
> +       bool replay;
> +       int err;
> +
> +replay:

For 1-1 mapping to original code, the line:
struct tcmsg *tcm = nlmsg_data(n);

Should move below the replay goto..

Other than that:
Reviewed-by: Jamal Hadi Salim <jhs@...atatu.com>

> +       /* Reinit, just in case something touches this. */
> +       err = nlmsg_parse_deprecated(n, sizeof(*tcm), tca, TCA_MAX,
> +                                    rtm_tca_policy, extack);

[..]

cheers,
jamal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ