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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 30 Sep 2022 16:22:19 +0200
From:   Nicolas Dichtel <nicolas.dichtel@...nd.com>
To:     Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc:     "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Ido Schimmel <idosch@...dia.com>,
        Petr Machata <petrm@...dia.com>,
        Florent Fourcot <florent.fourcot@...irst.fr>,
        Nikolay Aleksandrov <razor@...ckwall.org>,
        Guillaume Nault <gnault@...hat.com>,
        David Ahern <dsahern@...nel.org>
Subject: Re: [PATCHv5 net-next 1/4] rtnetlink: add new helper
 rtnl_configure_link_notify()


Le 30/09/2022 à 11:45, Hangbin Liu a écrit :
> This patch update rtnl_configure_link() to rtnl_configure_link_nlh() by
> adding parameter netlink message header and port id so we can notify the
> userspace about the new link info if NLM_F_ECHO flag is set.
> 
> The rtnl_configure_link() will be a wrapper of the new function. The new
> call chain looks like:
> 
> - rtnl_configure_link_notify()
>   - __dev_notify_flags()
>     - rtmsg_ifinfo_nlh()
>       - rtmsg_ifinfo_event()
>         - rtmsg_ifinfo_build_skb()
>         - rtmsg_ifinfo_send()
> 
> All the functions in this call chain will add parameter nlh and pid, so
> we can use them in the last call rtnl_notify().
> 
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
> ---
>  include/linux/netdevice.h |  2 +-
>  include/linux/rtnetlink.h |  6 ++++--
>  net/core/dev.c            | 14 ++++++-------
>  net/core/rtnetlink.c      | 41 ++++++++++++++++++++++++++-------------
>  4 files changed, 40 insertions(+), 23 deletions(-)
> 
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index eddf8ee270e7..a71d378945e3 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -3856,7 +3856,7 @@ int __dev_change_flags(struct net_device *dev, unsigned int flags,
>  int dev_change_flags(struct net_device *dev, unsigned int flags,
>  		     struct netlink_ext_ack *extack);
>  void __dev_notify_flags(struct net_device *, unsigned int old_flags,
> -			unsigned int gchanges);
> +			unsigned int gchanges, u32 pid, struct nlmsghdr *nlh);
Order is pid/nlh.

[snip]

> +void rtmsg_ifinfo_nlh(int type, struct net_device *dev, unsigned int change,
> +		      gfp_t flags, u32 pid, struct nlmsghdr *nlh);
Same here.

>  struct sk_buff *rtmsg_ifinfo_build_skb(int type, struct net_device *dev,
>  				       unsigned change, u32 event,
>  				       gfp_t flags, int *new_nsid,
> -				       int new_ifindex);
> +				       int new_ifindex, u32 pid, u32 seq);
Same here.

>  void rtmsg_ifinfo_send(struct sk_buff *skb, struct net_device *dev,
> -		       gfp_t flags);
> +		       gfp_t flags, u32 pid, struct nlmsghdr *nlh);
Same here.

[snip]


> -int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm)
> +static int rtnl_configure_link_notify(struct net_device *dev, const struct ifinfomsg *ifm,
> +				      struct nlmsghdr *nlh, u32 pid)
But not here. Following patches also use this order instead of the previous one.
For consistency, it could be good to keep the same order everywhere.


Regards,
Nicolas

Powered by blists - more mailing lists